Package com.tnsai.mcp.model
Class ResourceTemplate
java.lang.Object
com.tnsai.mcp.model.ResourceTemplate
Represents an MCP Resource Template.
Templates allow parameterized resource URIs using URI Template syntax (RFC 6570).
Example: "file:///{path}" where {path} is a variable.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionResourceTemplate(String uriTemplate, String name) ResourceTemplate(String uriTemplate, String name, String description, String mimeType) -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceTemplate.Builderbuilder()booleanExpands the template with the given variables.getName()inthashCode()booleanChecks if a URI matches this template.voidsetDescription(String description) voidsetMimeType(String mimeType) voidvoidsetUriTemplate(String uriTemplate) toString()
-
Constructor Details
-
ResourceTemplate
public ResourceTemplate() -
ResourceTemplate
-
ResourceTemplate
-
-
Method Details
-
getUriTemplate
-
setUriTemplate
-
getName
-
setName
-
getDescription
-
setDescription
-
getMimeType
-
setMimeType
-
expand
Expands the template with the given variables.- Parameters:
variables- Map of variable name to value- Returns:
- The expanded URI
-
matches
Checks if a URI matches this template.- Parameters:
uri- The URI to check- Returns:
- true if the URI could match this template pattern
-
equals
-
hashCode
public int hashCode() -
toString
-
builder
-