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.
public final classBetaClearToolUses20250919Edit.Trigger.Type
-
Method Summary
-
-
Method Detail
-
inputTokens
final Optional<BetaInputTokensTrigger> inputTokens()
-
toolUses
final Optional<BetaToolUsesTrigger> toolUses()
-
type
final BetaClearToolUses20250919Edit.Trigger.Type type()
-
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)
-
ofInputTokens
final static BetaClearToolUses20250919Edit.Trigger ofInputTokens(Long value)
Returns an immutable instance of Trigger whose ofInputTokens variant is built from the given required value.
-
ofToolUses
final static BetaClearToolUses20250919Edit.Trigger ofToolUses(BetaToolUsesTrigger toolUses)
-
ofToolUses
final static BetaClearToolUses20250919Edit.Trigger ofToolUses(Long value)
Returns an immutable instance of Trigger whose ofToolUses variant is built from the given required value.
-
-
-
-