Package io.stargate.auth.entity
Class ImmutableAuthorizedResource
- java.lang.Object
-
- io.stargate.auth.entity.ImmutableAuthorizedResource
-
- All Implemented Interfaces:
AuthorizedResource
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableAuthorizedResource extends Object implements AuthorizedResource
Immutable implementation ofAuthorizedResource.Use the builder to create immutable instances:
ImmutableAuthorizedResource.builder(). Use the static factory method to create immutable instances:ImmutableAuthorizedResource.of().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableAuthorizedResource.BuilderBuilds instances of typeImmutableAuthorizedResource.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableAuthorizedResource.Builderbuilder()Creates a builder forImmutableAuthorizedResource.static ImmutableAuthorizedResourcecopyOf(AuthorizedResource instance)Creates an immutable copy of aAuthorizedResourcevalue.EntitySelectorelement()Identifies the name of the resource.booleanequals(Object another)This instance is equal to all instances ofImmutableAuthorizedResourcethat have equal attribute values.inthashCode()Computes a hash code from attributes:kind,keyspace,element.EntitySelectorkeyspace()Identifies the keyspace of the resource.ResourceKindkind()Identifies the resource kind.static ImmutableAuthorizedResourceof(ResourceKind kind)Construct a new immutableAuthorizedResourceinstance.StringtoString()Prints the immutable valueAuthorizedResourcewith attribute values.ImmutableAuthorizedResourcewithElement(EntitySelector value)Copy the current immutable object by setting a value for theelementattribute.ImmutableAuthorizedResourcewithKeyspace(EntitySelector value)Copy the current immutable object by setting a value for thekeyspaceattribute.ImmutableAuthorizedResourcewithKind(ResourceKind value)Copy the current immutable object by setting a value for thekindattribute.
-
-
-
Method Detail
-
kind
public ResourceKind kind()
Identifies the resource kind.- Specified by:
kindin interfaceAuthorizedResource
-
keyspace
public EntitySelector keyspace()
Identifies the keyspace of the resource.If the keyspace selector is a wildcard, the
element()selector should also be a wildcard.- Specified by:
keyspacein interfaceAuthorizedResource
-
element
public EntitySelector element()
Identifies the name of the resource.- Specified by:
elementin interfaceAuthorizedResource
-
withKind
public final ImmutableAuthorizedResource withKind(ResourceKind value)
Copy the current immutable object by setting a value for thekindattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for kind- Returns:
- A modified copy of the
thisobject
-
withKeyspace
public final ImmutableAuthorizedResource withKeyspace(EntitySelector value)
Copy the current immutable object by setting a value for thekeyspaceattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for keyspace- Returns:
- A modified copy of the
thisobject
-
withElement
public final ImmutableAuthorizedResource withElement(EntitySelector value)
Copy the current immutable object by setting a value for theelementattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for element- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableAuthorizedResourcethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:kind,keyspace,element.
-
toString
public String toString()
Prints the immutable valueAuthorizedResourcewith attribute values.
-
of
public static ImmutableAuthorizedResource of(ResourceKind kind)
Construct a new immutableAuthorizedResourceinstance.- Parameters:
kind- The value for thekindattribute- Returns:
- An immutable AuthorizedResource instance
-
copyOf
public static ImmutableAuthorizedResource copyOf(AuthorizedResource instance)
Creates an immutable copy of aAuthorizedResourcevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable AuthorizedResource instance
-
builder
public static ImmutableAuthorizedResource.Builder builder()
Creates a builder forImmutableAuthorizedResource.ImmutableAuthorizedResource.builder() .kind(io.stargate.auth.entity.ResourceKind) // requiredkind.keyspace(io.stargate.auth.entity.EntitySelector) // optionalkeyspace.element(io.stargate.auth.entity.EntitySelector) // optionalelement.build();- Returns:
- A new ImmutableAuthorizedResource builder
-
-