Class MessageCreateParams.Container
-
- All Implemented Interfaces:
public final class MessageCreateParams.ContainerContainer identifier for reuse across requests.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceMessageCreateParams.Container.VisitorAn interface that defines how to map each variant of Container to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaContainerParams>betaContainerParams()Container parameters with skills to be loaded. final Optional<String>string()final BooleanisBetaContainerParams()final BooleanisString()final BetaContainerParamsasBetaContainerParams()Container parameters with skills to be loaded. final StringasString()final Optional<JsonValue>_json()final <T extends Any> Taccept(MessageCreateParams.Container.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final MessageCreateParams.Containervalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static MessageCreateParams.ContainerofBetaContainerParams(BetaContainerParams betaContainerParams)Container parameters with skills to be loaded. final static MessageCreateParams.ContainerofString(String string)-
-
Method Detail
-
betaContainerParams
final Optional<BetaContainerParams> betaContainerParams()
Container parameters with skills to be loaded.
-
isBetaContainerParams
final Boolean isBetaContainerParams()
-
asBetaContainerParams
final BetaContainerParams asBetaContainerParams()
Container parameters with skills to be loaded.
-
accept
final <T extends Any> T accept(MessageCreateParams.Container.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 = container.accept(new Container.Visitor<Optional<String>>() { @Override public Optional<String> visitBetaContainerParams(BetaContainerParams betaContainerParams) { return Optional.of(betaContainerParams.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final MessageCreateParams.Container 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.
-
ofBetaContainerParams
final static MessageCreateParams.Container ofBetaContainerParams(BetaContainerParams betaContainerParams)
Container parameters with skills to be loaded.
-
ofString
final static MessageCreateParams.Container ofString(String string)
-
-
-
-