Class ComplianceSettingsState
-
- All Implemented Interfaces:
public final class ComplianceSettingsState
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceComplianceSettingsState.VisitorAn interface that defines how to map each variant of ComplianceSettingsState to a value of type T.
public final classComplianceSettingsState.Type
-
Method Summary
Modifier and Type Method Description final Optional<ComplianceSettingsStateEnabled>enabled()final Optional<ComplianceSettingsStateDisabled>disabled()final Optional<JsonValue>_json()final ComplianceSettingsState.Typetype()final BooleanisEnabled()final BooleanisDisabled()final ComplianceSettingsStateEnabledasEnabled()final ComplianceSettingsStateDisabledasDisabled()final <T extends Any> Taccept(ComplianceSettingsState.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final ComplianceSettingsStatevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ComplianceSettingsStateofEnabled(ComplianceSettingsStateEnabled enabled)final static ComplianceSettingsStateofDisabled(ComplianceSettingsStateDisabled disabled)-
-
Method Detail
-
enabled
final Optional<ComplianceSettingsStateEnabled> enabled()
-
disabled
final Optional<ComplianceSettingsStateDisabled> disabled()
-
type
final ComplianceSettingsState.Type type()
-
isDisabled
final Boolean isDisabled()
-
asEnabled
final ComplianceSettingsStateEnabled asEnabled()
-
asDisabled
final ComplianceSettingsStateDisabled asDisabled()
-
accept
final <T extends Any> T accept(ComplianceSettingsState.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 = complianceSettingsState.accept(new ComplianceSettingsState.Visitor<Optional<String>>() { @Override public Optional<String> visitEnabled(ComplianceSettingsStateEnabled enabled) { return Optional.of(enabled.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ComplianceSettingsState 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.
-
ofEnabled
final static ComplianceSettingsState ofEnabled(ComplianceSettingsStateEnabled enabled)
-
ofDisabled
final static ComplianceSettingsState ofDisabled(ComplianceSettingsStateDisabled disabled)
-
-
-
-