Class McpResourceRegistration.ExactBuilder
java.lang.Object
com.soklet.McpResourceRegistration.ExactBuilder
- Enclosing class:
McpResourceRegistration
Mutable builder for an immutable exact-resource registration.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionannotations(@NonNull McpContentAnnotations annotations) build()cachePolicy(@NonNull McpCachePolicy cachePolicy) description(@NonNull String description) Replaces icon descriptors in supplied order.inputRequestDeclarations(@Nullable List<@NonNull McpInputRequestDeclaration> inputRequestDeclarations) Replaces input-request declarations in supplied order.metadata(@NonNull McpJsonObject metadata) requestStateMode(@NonNull McpRequestStateMode requestStateMode) Sets the request-state contract for this resource operation.sizeInBytes(@NonNull Long sizeInBytes) Sets the exact resource's size in bytes.
-
Method Details
-
title
- Parameters:
title- human-readable title- Returns:
- this builder
-
description
- Parameters:
description- human-readable description- Returns:
- this builder
-
mimeType
- Parameters:
mimeType- syntactically valid resource MIME type- Returns:
- this builder
- Throws:
IllegalArgumentException- ifmimeTypeis malformed
-
icons
Replaces icon descriptors in supplied order. Null or empty clears the property. The complete list is validated and snapshotted before replacing the prior value.- Parameters:
icons- icon descriptors, or null to clear- Returns:
- this builder
- Throws:
NullPointerException- if a list element is null
-
annotations
public @NonNull McpResourceRegistration.ExactBuilder annotations(@NonNull McpContentAnnotations annotations) - Parameters:
annotations- content annotations- Returns:
- this builder
-
sizeInBytes
Sets the exact resource's size in bytes.- Parameters:
sizeInBytes- nonnegative byte count- Returns:
- this builder
- Throws:
NullPointerException- ifsizeInBytesis nullIllegalArgumentException- ifsizeInBytesis negative
-
cachePolicy
public @NonNull McpResourceRegistration.ExactBuilder cachePolicy(@NonNull McpCachePolicy cachePolicy) - Parameters:
cachePolicy- fixed scope and default time to live- Returns:
- this builder
-
inputRequestDeclarations
public @NonNull McpResourceRegistration.ExactBuilder inputRequestDeclarations(@Nullable List<@NonNull McpInputRequestDeclaration> inputRequestDeclarations) Replaces input-request declarations in supplied order. Null or empty clears the property. The complete list is validated and snapshotted before replacing the prior value.- Parameters:
inputRequestDeclarations- input-request declarations, or null to clear- Returns:
- this builder
- Throws:
NullPointerException- if a list element is null
-
requestStateMode
public @NonNull McpResourceRegistration.ExactBuilder requestStateMode(@NonNull McpRequestStateMode requestStateMode) Sets the request-state contract for this resource operation.- Parameters:
requestStateMode- request-state mode- Returns:
- this builder
-
metadata
- Parameters:
metadata- protocol extension metadata- Returns:
- this builder
-
build
- Returns:
- immutable exact-resource registration
-