Package com.anthropic.models.messages
Class BashCodeExecutionToolResultBlockParam.Content
-
- All Implemented Interfaces:
public final class BashCodeExecutionToolResultBlockParam.Content
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBashCodeExecutionToolResultBlockParam.Content.VisitorAn interface that defines how to map each variant of Content to a value of type T.
-
Method Summary
-
-
Method Detail
-
bashCodeExecutionToolResultErrorParam
final Optional<BashCodeExecutionToolResultErrorParam> bashCodeExecutionToolResultErrorParam()
-
bashCodeExecutionResultBlockParam
final Optional<BashCodeExecutionResultBlockParam> bashCodeExecutionResultBlockParam()
-
isBashCodeExecutionToolResultErrorParam
final Boolean isBashCodeExecutionToolResultErrorParam()
-
isBashCodeExecutionResultBlockParam
final Boolean isBashCodeExecutionResultBlockParam()
-
asBashCodeExecutionToolResultErrorParam
final BashCodeExecutionToolResultErrorParam asBashCodeExecutionToolResultErrorParam()
-
asBashCodeExecutionResultBlockParam
final BashCodeExecutionResultBlockParam asBashCodeExecutionResultBlockParam()
-
accept
final <T extends Any> T accept(BashCodeExecutionToolResultBlockParam.Content.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 = content.accept(new Content.Visitor<Optional<String>>() { @Override public Optional<String> visitBashCodeExecutionToolResultErrorParam(BashCodeExecutionToolResultErrorParam bashCodeExecutionToolResultErrorParam) { return Optional.of(bashCodeExecutionToolResultErrorParam.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BashCodeExecutionToolResultBlockParam.Content 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.
-
ofBashCodeExecutionToolResultErrorParam
final static BashCodeExecutionToolResultBlockParam.Content ofBashCodeExecutionToolResultErrorParam(BashCodeExecutionToolResultErrorParam bashCodeExecutionToolResultErrorParam)
-
ofBashCodeExecutionResultBlockParam
final static BashCodeExecutionToolResultBlockParam.Content ofBashCodeExecutionResultBlockParam(BashCodeExecutionResultBlockParam bashCodeExecutionResultBlockParam)
-
-
-
-