Class AbstractMcpResourceMethodCallback.AbstractBuilder<T extends AbstractMcpResourceMethodCallback.AbstractBuilder<T,R>,R>
java.lang.Object
org.springaicommunity.mcp.method.resource.AbstractMcpResourceMethodCallback.AbstractBuilder<T,R>
- Type Parameters:
T- The type of the builderR- The type of the callback
- Direct Known Subclasses:
AsyncMcpResourceMethodCallback.Builder,AsyncStatelessMcpResourceMethodCallback.Builder,SyncMcpResourceMethodCallback.Builder,SyncStatelessMcpResourceMethodCallback.Builder
- Enclosing class:
- AbstractMcpResourceMethodCallback
protected abstract static class AbstractMcpResourceMethodCallback.AbstractBuilder<T extends AbstractMcpResourceMethodCallback.AbstractBuilder<T,R>,R>
extends Object
Abstract builder for creating McpResourceMethodCallback instances.
This builder provides a base for constructing callback instances with the required parameters.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet the bean instance that contains the method.abstract Rbuild()Build the callback.contentType(AbstractMcpResourceMethodCallback.ContentType contentType) Set the content type.description(String description) Set the description of the resource.Set the method to create a callback for.Set the MIME type of the resource.Set the name of the resource.resource(io.modelcontextprotocol.spec.McpSchema.Resource resource) Set the Mcp Schema resource.resource(io.modelcontextprotocol.spec.McpSchema.ResourceTemplate resourceTemplate) Set the Mcp Schema resource template.resultConverter(McpReadResourceResultConverter resultConverter) Set the result converter.Set the URI for the resource.uriTemplateManagerFactory(io.modelcontextprotocol.util.McpUriTemplateManagerFactory uriTemplateManagerFactory) Set the URI template manager factory.protected voidvalidate()Validate the builder state.
-
Field Details
-
method
-
bean
-
resultConverter
-
uriTemplateManagerFactory
protected io.modelcontextprotocol.util.McpUriTemplateManagerFactory uriTemplateManagerFactory -
contentType
-
name
-
description
-
mimeType
-
uri
-
-
Constructor Details
-
AbstractBuilder
protected AbstractBuilder()
-
-
Method Details
-
method
Set the method to create a callback for.- Parameters:
method- The method to create a callback for- Returns:
- This builder
-
bean
Set the bean instance that contains the method.- Parameters:
bean- The bean instance- Returns:
- This builder
-
uri
Set the URI for the resource.- Parameters:
uri- The URI for the resource- Returns:
- This builder
-
resource
Set the Mcp Schema resource.- Parameters:
resource- The resource- Returns:
- This builder
-
resource
Set the Mcp Schema resource template.- Parameters:
resourceTemplate- The resource template- Returns:
- This builder
-
resultConverter
Set the result converter.- Parameters:
resultConverter- The result converter- Returns:
- This builder
-
uriTemplateManagerFactory
public T uriTemplateManagerFactory(io.modelcontextprotocol.util.McpUriTemplateManagerFactory uriTemplateManagerFactory) Set the URI template manager factory.- Parameters:
uriTemplateManagerFactory- The URI template manager factory- Returns:
- This builder
-
contentType
Set the content type.- Parameters:
contentType- The content type- Returns:
- This builder
-
name
Set the name of the resource.- Parameters:
name- The name of the resource- Returns:
- This builder
-
description
Set the description of the resource.- Parameters:
description- The description of the resource- Returns:
- This builder
-
mimeType
Set the MIME type of the resource.- Parameters:
mimeType- The MIME type of the resource- Returns:
- This builder
-
validate
protected void validate()Validate the builder state.- Throws:
IllegalArgumentException- if the builder state is invalid
-
build
Build the callback.- Returns:
- A new callback instance
-