Package dev.tachyonmcp.api.server.domain
Interface UriTemplateValue
- All Known Implementing Classes:
UriTemplateValue.Scalar,UriTemplateValue.Sequence
Value recovered from an RFC 6570 URI template.
Associative values are intentionally unsupported until MCP defines variable schemas that can distinguish them from sequences.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA scalar template variable.static final recordAn exploded list template variable. -
Method Summary
Modifier and TypeMethodDescriptiondefault UriTemplateValue.ScalarasScalar()Converts this value to a scalar representation.default UriTemplateValue.SequenceProvides the value as a sequence.default StringGets the scalar text represented by this value.
-
Method Details
-
scalarValue
Gets the scalar text represented by this value.- Returns:
- the scalar value or the sole element of a sequence
- Throws:
IllegalStateException- if the sequence contains more than one elementUnsupportedOperationException- if the value type is unsupported
-
asScalar
Converts this value to a scalar representation.- Returns:
- this value when it is scalar; otherwise, a scalar containing its value
-
asSequence
Provides the value as a sequence.- Returns:
- this value if it is already a sequence; otherwise, a single-element sequence containing the scalar value
-