Class ImmutableAuthorizedResource

  • All Implemented Interfaces:
    AuthorizedResource

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    public final class ImmutableAuthorizedResource
    extends Object
    implements AuthorizedResource
    Immutable implementation of AuthorizedResource.

    Use the builder to create immutable instances: ImmutableAuthorizedResource.builder(). Use the static factory method to create immutable instances: ImmutableAuthorizedResource.of().

    • Method Detail

      • withKind

        public final ImmutableAuthorizedResource withKind​(ResourceKind value)
        Copy the current immutable object by setting a value for the kind attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for kind
        Returns:
        A modified copy of the this object
      • withKeyspace

        public final ImmutableAuthorizedResource withKeyspace​(EntitySelector value)
        Copy the current immutable object by setting a value for the keyspace attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for keyspace
        Returns:
        A modified copy of the this object
      • withElement

        public final ImmutableAuthorizedResource withElement​(EntitySelector value)
        Copy the current immutable object by setting a value for the element attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for element
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableAuthorizedResource that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: kind, keyspace, element.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value AuthorizedResource with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • of

        public static ImmutableAuthorizedResource of​(ResourceKind kind)
        Construct a new immutable AuthorizedResource instance.
        Parameters:
        kind - The value for the kind attribute
        Returns:
        An immutable AuthorizedResource instance
      • copyOf

        public static ImmutableAuthorizedResource copyOf​(AuthorizedResource instance)
        Creates an immutable copy of a AuthorizedResource value. 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 for ImmutableAuthorizedResource.
         ImmutableAuthorizedResource.builder()
            .kind(io.stargate.auth.entity.ResourceKind) // required kind
            .keyspace(io.stargate.auth.entity.EntitySelector) // optional keyspace
            .element(io.stargate.auth.entity.EntitySelector) // optional element
            .build();
         
        Returns:
        A new ImmutableAuthorizedResource builder