Class BetaClearToolUses20250919Edit.Trigger
-
- All Implemented Interfaces:
public final class BetaClearToolUses20250919Edit.TriggerCondition that triggers the context management strategy
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaClearToolUses20250919Edit.Trigger.VisitorAn interface that defines how to map each variant of Trigger to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaInputTokensTrigger>inputTokens()final Optional<BetaToolUsesTrigger>toolUses()final BooleanisInputTokens()final BooleanisToolUses()final BetaInputTokensTriggerasInputTokens()final BetaToolUsesTriggerasToolUses()final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaClearToolUses20250919Edit.Trigger.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaClearToolUses20250919Edit.Triggervalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaClearToolUses20250919Edit.TriggerofInputTokens(BetaInputTokensTrigger inputTokens)final static BetaClearToolUses20250919Edit.TriggerofToolUses(BetaToolUsesTrigger toolUses)-
-
Method Detail
-
inputTokens
final Optional<BetaInputTokensTrigger> inputTokens()
-
toolUses
final Optional<BetaToolUsesTrigger> toolUses()
-
isInputTokens
final Boolean isInputTokens()
-
isToolUses
final Boolean isToolUses()
-
asInputTokens
final BetaInputTokensTrigger asInputTokens()
-
asToolUses
final BetaToolUsesTrigger asToolUses()
-
accept
final <T extends Any> T accept(BetaClearToolUses20250919Edit.Trigger.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 = trigger.accept(new Trigger.Visitor<Optional<String>>() { @Override public Optional<String> visitInputTokens(BetaInputTokensTrigger inputTokens) { return Optional.of(inputTokens.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaClearToolUses20250919Edit.Trigger 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.
-
ofInputTokens
final static BetaClearToolUses20250919Edit.Trigger ofInputTokens(BetaInputTokensTrigger inputTokens)
-
ofToolUses
final static BetaClearToolUses20250919Edit.Trigger ofToolUses(BetaToolUsesTrigger toolUses)
-
-
-
-