Package com.anthropic.models.messages
Interface ContentBlock.Visitor
-
- All Implemented Interfaces:
public interface ContentBlock.Visitor<T extends Object>An interface that defines how to map each variant of ContentBlock to a value of type T.
-
-
Method Summary
Modifier and Type Method Description abstract TvisitText(TextBlock text)abstract TvisitToolUse(ToolUseBlock toolUse)abstract TvisitThinking(ThinkingBlock thinking)abstract TvisitRedactedThinking(RedactedThinkingBlock redactedThinking)Tunknown(JsonValue json)Maps an unknown variant of ContentBlock to a value of type T. -
-
Method Detail
-
visitToolUse
abstract T visitToolUse(ToolUseBlock toolUse)
-
visitThinking
abstract T visitThinking(ThinkingBlock thinking)
-
visitRedactedThinking
abstract T visitRedactedThinking(RedactedThinkingBlock redactedThinking)
-
unknown
T unknown(JsonValue json)
Maps an unknown variant of ContentBlock to a value of type T.
An instance of ContentBlock can contain an unknown variant if it was deserialized from data that doesn't match any known variant. For example, if the SDK is on an older version than the API, then the API may respond with new variants that the SDK is unaware of.
-
-
-
-