Class BetaToolUseBlockParam.Caller
-
- All Implemented Interfaces:
public final class BetaToolUseBlockParam.CallerTool invocation directly from the model.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaToolUseBlockParam.Caller.VisitorAn interface that defines how to map each variant of Caller to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaDirectCaller>direct()Tool invocation directly from the model. final Optional<BetaServerToolCaller>codeExecution20250825()Tool invocation generated by a server-side tool. final Optional<BetaServerToolCaller20260120>codeExecution20260120()final BooleanisDirect()final BooleanisCodeExecution20250825()final BooleanisCodeExecution20260120()final BetaDirectCallerasDirect()Tool invocation directly from the model. final BetaServerToolCallerasCodeExecution20250825()Tool invocation generated by a server-side tool. final BetaServerToolCaller20260120asCodeExecution20260120()final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaToolUseBlockParam.Caller.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaToolUseBlockParam.Callervalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaToolUseBlockParam.CallerofDirect(BetaDirectCaller direct)Tool invocation directly from the model. final static BetaToolUseBlockParam.CallerofCodeExecution20250825(BetaServerToolCaller codeExecution20250825)Tool invocation generated by a server-side tool. final static BetaToolUseBlockParam.CallerofCodeExecution20260120(BetaServerToolCaller20260120 codeExecution20260120)-
-
Method Detail
-
direct
final Optional<BetaDirectCaller> direct()
Tool invocation directly from the model.
-
codeExecution20250825
final Optional<BetaServerToolCaller> codeExecution20250825()
Tool invocation generated by a server-side tool.
-
codeExecution20260120
final Optional<BetaServerToolCaller20260120> codeExecution20260120()
-
isCodeExecution20250825
final Boolean isCodeExecution20250825()
-
isCodeExecution20260120
final Boolean isCodeExecution20260120()
-
asDirect
final BetaDirectCaller asDirect()
Tool invocation directly from the model.
-
asCodeExecution20250825
final BetaServerToolCaller asCodeExecution20250825()
Tool invocation generated by a server-side tool.
-
asCodeExecution20260120
final BetaServerToolCaller20260120 asCodeExecution20260120()
-
accept
final <T extends Any> T accept(BetaToolUseBlockParam.Caller.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.anthropic.core.JsonValue; import java.util.Optional; Optional<String> result = caller.accept(new Caller.Visitor<Optional<String>>() { @Override public Optional<String> visitDirect(BetaDirectCaller direct) { return Optional.of(direct.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaToolUseBlockParam.Caller validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofDirect
final static BetaToolUseBlockParam.Caller ofDirect(BetaDirectCaller direct)
Tool invocation directly from the model.
-
ofCodeExecution20250825
final static BetaToolUseBlockParam.Caller ofCodeExecution20250825(BetaServerToolCaller codeExecution20250825)
Tool invocation generated by a server-side tool.
-
ofCodeExecution20260120
final static BetaToolUseBlockParam.Caller ofCodeExecution20260120(BetaServerToolCaller20260120 codeExecution20260120)
-
-
-
-