Package com.anthropic.models
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 BooleanisText()final BooleanisToolUse()final TextBlockasText()final ToolUseBlockasToolUse()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)-
-
Method Detail
-
toParam
final ContentBlockParam toParam()
-
toolUse
final Optional<ToolUseBlock> toolUse()
-
asToolUse
final ToolUseBlock asToolUse()
-
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)
-
-
-
-