Record Class McpListResourcesResult
java.lang.Object
java.lang.Record
com.soklet.McpListResourcesResult
@Immutable
public record McpListResourcesResult(@NonNull List<@NonNull McpListedResource> resources, @Nullable String nextCursor)
extends Record
Immutable result for
resources/list.- Author:
- Mark Allen
-
Constructor Summary
ConstructorsConstructorDescriptionMcpListResourcesResult(@NonNull List<@NonNull McpListedResource> resources, @Nullable String nextCursor) Creates an instance of aMcpListResourcesResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static @NonNull McpListResourcesResultfromResources(@NonNull List<@NonNull McpListedResource> resources) Creates a non-paginatedresources/listresult.static @NonNull McpListResourcesResultfromResourcesAndNextCursor(@NonNull List<@NonNull McpListedResource> resources, @NonNull String nextCursor) Creates a paginatedresources/listresult.final inthashCode()Returns a hash code value for this object.Returns the value of thenextCursorrecord component.Returns the value of theresourcesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
McpListResourcesResult
public McpListResourcesResult(@NonNull List<@NonNull McpListedResource> resources, @Nullable String nextCursor) Creates an instance of aMcpListResourcesResultrecord class.- Parameters:
resources- the value for theresourcesrecord componentnextCursor- the value for thenextCursorrecord component
-
-
Method Details
-
fromResources
public static @NonNull McpListResourcesResult fromResources(@NonNull List<@NonNull McpListedResource> resources) Creates a non-paginatedresources/listresult.- Parameters:
resources- the listed resources- Returns:
- a result without a next cursor
-
fromResourcesAndNextCursor
public static @NonNull McpListResourcesResult fromResourcesAndNextCursor(@NonNull List<@NonNull McpListedResource> resources, @NonNull String nextCursor) Creates a paginatedresources/listresult.- Parameters:
resources- the listed resources for the current pagenextCursor- the cursor clients should use to request the next page- Returns:
- a paginated list result
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
resources
Returns the value of theresourcesrecord component.- Returns:
- the value of the
resourcesrecord component
-
nextCursor
Returns the value of thenextCursorrecord component.- Returns:
- the value of the
nextCursorrecord component
-