Record Class ResourceTemplateEntry
java.lang.Object
java.lang.Record
dev.tachyonmcp.core.server.features.resources.ResourceTemplateEntry
- All Implemented Interfaces:
ServerFeature<ResourceTemplateDescriptor>
@InternalApi
public record ResourceTemplateEntry(ResourceTemplateDescriptor descriptor, AsyncResourceFn fn, UriTemplate uriTemplate)
extends Record
implements ServerFeature<ResourceTemplateDescriptor>
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.tachyonmcp.api.server.ServerFeature
ServerFeature.Descriptor, ServerFeature.Request -
Constructor Summary
ConstructorsConstructorDescriptionResourceTemplateEntry(ResourceTemplateDescriptor descriptor, AsyncResourceFn fn, UriTemplate uriTemplate) Creates an instance of aResourceTemplateEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescriptorrecord component.final booleanIndicates whether some other object is "equal to" this one.fn()Returns the value of thefnrecord component.final inthashCode()Returns a hash code value for this object.static ResourceTemplateEntryof(ResourceTemplateDescriptor descriptor, AsyncResourceFn fn) Creates a resource template entry from its descriptor and handler.final StringtoString()Returns a string representation of this record class.Returns the value of theuriTemplaterecord component.
-
Constructor Details
-
ResourceTemplateEntry
public ResourceTemplateEntry(ResourceTemplateDescriptor descriptor, AsyncResourceFn fn, UriTemplate uriTemplate) Creates an instance of aResourceTemplateEntryrecord class.- Parameters:
descriptor- the value for thedescriptorrecord componentfn- the value for thefnrecord componenturiTemplate- the value for theuriTemplaterecord component
-
-
Method Details
-
of
Creates a resource template entry from its descriptor and handler.- Parameters:
descriptor- the resource template descriptorfn- the resource function- Returns:
- the created resource template entry
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
descriptor
Returns the value of thedescriptorrecord component.- Specified by:
descriptorin interfaceServerFeature<ResourceTemplateDescriptor>- Returns:
- the value of the
descriptorrecord component
-
fn
Returns the value of thefnrecord component.- Returns:
- the value of the
fnrecord component
-
uriTemplate
Returns the value of theuriTemplaterecord component.- Returns:
- the value of the
uriTemplaterecord component
-