Class RbacRoleSource
-
- All Implemented Interfaces:
public final class RbacRoleSource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRbacRoleSource.VisitorAn interface that defines how to map each variant of RbacRoleSource to a value of type T.
public final classRbacRoleSource.Type
-
Method Summary
Modifier and Type Method Description final Optional<RbacRoleSourceBuiltIn>builtIn()final Optional<RbacRoleSourceCustom>custom()final Optional<JsonValue>_json()final RbacRoleSource.Typetype()final BooleanisBuiltIn()final BooleanisCustom()final RbacRoleSourceBuiltInasBuiltIn()final RbacRoleSourceCustomasCustom()final <T extends Any> Taccept(RbacRoleSource.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final RbacRoleSourcevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static RbacRoleSourceofBuiltIn(RbacRoleSourceBuiltIn builtIn)final static RbacRoleSourceofCustom(RbacRoleSourceCustom custom)-
-
Method Detail
-
builtIn
final Optional<RbacRoleSourceBuiltIn> builtIn()
-
custom
final Optional<RbacRoleSourceCustom> custom()
-
type
final RbacRoleSource.Type type()
-
asBuiltIn
final RbacRoleSourceBuiltIn asBuiltIn()
-
asCustom
final RbacRoleSourceCustom asCustom()
-
accept
final <T extends Any> T accept(RbacRoleSource.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 = rbacRoleSource.accept(new RbacRoleSource.Visitor<Optional<String>>() { @Override public Optional<String> visitBuiltIn(RbacRoleSourceBuiltIn builtIn) { return Optional.of(builtIn.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final RbacRoleSource 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.
-
ofBuiltIn
final static RbacRoleSource ofBuiltIn(RbacRoleSourceBuiltIn builtIn)
-
ofCustom
final static RbacRoleSource ofCustom(RbacRoleSourceCustom custom)
-
-
-
-