Class McpResourcePage.Builder
java.lang.Object
com.soklet.McpResourcePage.Builder
- Enclosing class:
McpResourcePage
Mutable builder for an immutable resource page.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()cacheTimeToLiveOverride(@NonNull Duration cacheTimeToLiveOverride) Overrides only the endpoint's default time to live for this page.metadata(@NonNull McpJsonObject metadata) nextCursor(@NonNull String nextCursor) Supplies the opaque cursor clients should use for the next page.resourceDescriptors(@Nullable List<@NonNull McpResourceDescriptor> resourceDescriptors) Replaces resource descriptors in supplied order.
-
Method Details
-
resourceDescriptors
public @NonNull McpResourcePage.Builder resourceDescriptors(@Nullable List<@NonNull McpResourceDescriptor> resourceDescriptors) Replaces resource descriptors in supplied order. Null or empty clears the property. The complete list is validated and snapshotted before replacing the prior value.- Parameters:
resourceDescriptors- resource descriptors, or null to clear- Returns:
- this builder
- Throws:
NullPointerException- if a list element is null
-
metadata
- Parameters:
metadata- result-level protocol extension metadata- Returns:
- this builder
-
nextCursor
Supplies the opaque cursor clients should use for the next page.The application owns the cursor's integrity, confidentiality, authorization binding, expiry, page position, retained snapshot, catalog revision, and cross-instance portability. An empty string remains a present protocol value. Soklet enforces its configured outgoing UTF-8 bound but does not mint or protect the value.
- Parameters:
nextCursor- next cursor- Returns:
- this builder
- Throws:
IllegalArgumentException- if the cursor contains malformed UTF-16
-
cacheTimeToLiveOverride
public @NonNull McpResourcePage.Builder cacheTimeToLiveOverride(@NonNull Duration cacheTimeToLiveOverride) Overrides only the endpoint's default time to live for this page.- Parameters:
cacheTimeToLiveOverride- nonnegative whole-millisecond duration- Returns:
- this builder
- Throws:
IllegalArgumentException- if the duration is negative or has sub-millisecond precision
-
build
- Returns:
- immutable resource page
-