Class Result<T extends Result<T>>
- Type Parameters:
T- The concrete subclass, for fluent-setter self-typing.
- Direct Known Subclasses:
CacheableResult,CallToolResult,CompleteResult,GetPromptResult,InputRequiredResult,PingResult,SubscriptionsListenResult
2026-07-28 result, carrying the required resultType
discriminator and optional ResultMeta under the reserved _meta wire key.
The 2026-07-28 schema declares resultType as an open string union: "complete" and
"input_required" (InputRequiredResult, MRTR / SEP-2322) are the values this bean model
permits. Only "complete" is emitted by any dispatch path today; "input_required" becomes
reachable once MRTR pause/resume dispatch wiring is in place. Parsing remains lossless regardless and
accepts any string a peer might send. The field therefore defaults to "complete" rather than being
validated against a closed enumeration.
CacheableResult extends this base so the five cacheable list/read results inherit resultType
and _meta alongside their cache hints. Every other concrete result bean (CallToolResult,
GetPromptResult, CompleteResult, and PingResult) extends this base directly.
The CRTP type parameter lets each concrete subclass's fluent setters return its own concrete type for method
chaining, without duplicating the resultType / _meta accessors in every subclass.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetMeta()Result metadata: server identity plus any echoed trace context.Result-type discriminator.setMeta(ResultMeta value) Sets the result metadata.setResultType(String value) Sets the result-type discriminator.
-
Constructor Details
-
Result
public Result()
-
-
Method Details
-
getResultType
Result-type discriminator.Defaults to
"complete". The schema defines this as an open string union, so parsing accepts any string losslessly.- Returns:
- The result type. Never
null on a server-constructed instance.
-
setResultType
Sets the result-type discriminator.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getMeta
Result metadata: server identity plus any echoed trace context.- Returns:
- The metadata, or
nullif not set.
-
setMeta
Sets the result metadata.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-