Class ImmutableAclUserContext

java.lang.Object
org.bremersee.acl.ImmutableAclUserContext
All Implemented Interfaces:
AclUserContext

@Generated(from="AclUserContext", generator="Immutables") @Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableAclUserContext extends Object implements AclUserContext
Immutable implementation of AclUserContext.

Use the builder to create immutable instances: ImmutableAclUserContext.builder().

  • Method Details

    • getName

      public String getName()
      Gets name.
      Specified by:
      getName in interface AclUserContext
      Returns:
      the name
    • getRoles

      public Collection<String> getRoles()
      Gets roles.
      Specified by:
      getRoles in interface AclUserContext
      Returns:
      the roles
    • getGroups

      public Collection<String> getGroups()
      Gets groups.
      Specified by:
      getGroups in interface AclUserContext
      Returns:
      the groups
    • withName

      public final ImmutableAclUserContext withName(String value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy or the this object
    • withRoles

      public final ImmutableAclUserContext withRoles(Collection<String> value)
      Copy the current immutable object by setting a value for the roles attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for roles
      Returns:
      A modified copy or the this object
    • withGroups

      public final ImmutableAclUserContext withGroups(Collection<String> value)
      Copy the current immutable object by setting a value for the groups attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for groups
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableAclUserContext 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: name, roles, groups.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableAclUserContext copyOf(AclUserContext instance)
      Creates an immutable copy of a AclUserContext 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 AclUserContext instance
    • builder

      public static ImmutableAclUserContext.Builder builder()
      Creates a builder for ImmutableAclUserContext.
       ImmutableAclUserContext.builder()
          .name(String) // optional name
          .roles(Collection<String>) // optional roles
          .groups(Collection<String>) // optional groups
          .build();
       
      Returns:
      A new ImmutableAclUserContext builder