Package org.bremersee.acl
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().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableAclUserContext. -
Field Summary
Fields inherited from interface org.bremersee.acl.AclUserContext
ANONYMOUS -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableAclUserContext.static ImmutableAclUserContextcopyOf(AclUserContext instance) Creates an immutable copy of aAclUserContextvalue.booleanThis instance is equal to all instances ofImmutableAclUserContextthat have equal attribute values.Gets groups.getName()Gets name.getRoles()Gets roles.inthashCode()Computes a hash code from attributes:name,roles,groups.toString()Prints the immutable valueAclUserContextwith attribute values.final ImmutableAclUserContextwithGroups(Collection<String> value) Copy the current immutable object by setting a value for thegroupsattribute.final ImmutableAclUserContextCopy the current immutable object by setting a value for thenameattribute.final ImmutableAclUserContextwithRoles(Collection<String> value) Copy the current immutable object by setting a value for therolesattribute.
-
Method Details
-
getName
Gets name.- Specified by:
getNamein interfaceAclUserContext- Returns:
- the name
-
getRoles
Gets roles.- Specified by:
getRolesin interfaceAclUserContext- Returns:
- the roles
-
getGroups
Gets groups.- Specified by:
getGroupsin interfaceAclUserContext- Returns:
- the groups
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy or the
thisobject
-
withRoles
Copy the current immutable object by setting a value for therolesattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for roles- Returns:
- A modified copy or the
thisobject
-
withGroups
Copy the current immutable object by setting a value for thegroupsattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for groups- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutableAclUserContextthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:name,roles,groups. -
toString
Prints the immutable valueAclUserContextwith attribute values. -
copyOf
Creates an immutable copy of aAclUserContextvalue. 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
Creates a builder forImmutableAclUserContext.ImmutableAclUserContext.builder() .name(String) // optionalname.roles(Collection<String>) // optionalroles.groups(Collection<String>) // optionalgroups.build();- Returns:
- A new ImmutableAclUserContext builder
-