Package io.quarkiverse.mcp.server
Record Class MetaKey
java.lang.Object
java.lang.Record
io.quarkiverse.mcp.server.MetaKey
A key for additional metadata defined in the
_meta part of the message.
_meta keys have two segments: an optional prefix, and a name.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static MetaKeyCreate a new key from the specified string value, i.e. fromfoo.bar/myKey.final inthashCode()Returns a hash code value for this object.static booleanisValidName(String value) static booleanisValidPrefix(String value) name()Returns the value of thenamerecord component.static MetaKeyCreate a new key with the specified name but without a prefix.static MetaKeyCreate a new key with the specified name and the prefix is built from the supplied labels.prefix()Returns the value of theprefixrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
MetaKey
Creates an instance of aMetaKeyrecord class.- Parameters:
prefix- the value for theprefixrecord componentname- the value for thenamerecord component
-
-
Method Details
-
from
Create a new key from the specified string value, i.e. fromfoo.bar/myKey.- Parameters:
value-- Returns:
- the key
-
of
Create a new key with the specified name but without a prefix.- Parameters:
name-- Returns:
- the key
-
of
Create a new key with the specified name and the prefix is built from the supplied labels.Note that
modelcontextprotocolandmcplabels are reserved for MCP spec.- Parameters:
name-- Returns:
- the key
-
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. -
isValidName
-
isValidPrefix
-
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). -
prefix
Returns the value of theprefixrecord component.- Returns:
- the value of the
prefixrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-