Package com.anthropic.models.messages
Class ContentBlock
-
- All Implemented Interfaces:
public final class ContentBlock
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceContentBlock.VisitorAn interface that defines how to map each variant of ContentBlock to a value of type T.
-
Method Summary
Modifier and Type Method Description final ContentBlockParamtoParam()final Optional<TextBlock>text()final Optional<ToolUseBlock>toolUse()final Optional<ThinkingBlock>thinking()final Optional<RedactedThinkingBlock>redactedThinking()final BooleanisText()final BooleanisToolUse()final BooleanisThinking()final BooleanisRedactedThinking()final TextBlockasText()final ToolUseBlockasToolUse()final ThinkingBlockasThinking()final RedactedThinkingBlockasRedactedThinking()final Optional<JsonValue>_json()final <T extends Any> Taccept(ContentBlock.Visitor<T> visitor)final ContentBlockvalidate()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ContentBlockofText(TextBlock text)final static ContentBlockofToolUse(ToolUseBlock toolUse)final static ContentBlockofThinking(ThinkingBlock thinking)final static ContentBlockofRedactedThinking(RedactedThinkingBlock redactedThinking)-
-
Method Detail
-
toParam
final ContentBlockParam toParam()
-
toolUse
final Optional<ToolUseBlock> toolUse()
-
thinking
final Optional<ThinkingBlock> thinking()
-
redactedThinking
final Optional<RedactedThinkingBlock> redactedThinking()
-
isThinking
final Boolean isThinking()
-
isRedactedThinking
final Boolean isRedactedThinking()
-
asToolUse
final ToolUseBlock asToolUse()
-
asThinking
final ThinkingBlock asThinking()
-
asRedactedThinking
final RedactedThinkingBlock asRedactedThinking()
-
accept
final <T extends Any> T accept(ContentBlock.Visitor<T> visitor)
-
validate
final ContentBlock validate()
-
ofText
final static ContentBlock ofText(TextBlock text)
-
ofToolUse
final static ContentBlock ofToolUse(ToolUseBlock toolUse)
-
ofThinking
final static ContentBlock ofThinking(ThinkingBlock thinking)
-
ofRedactedThinking
final static ContentBlock ofRedactedThinking(RedactedThinkingBlock redactedThinking)
-
-
-
-