Package org.bremersee.acl.model
Class ImmutableAccessControlEntry
java.lang.Object
org.bremersee.acl.model.ImmutableAccessControlEntry
- All Implemented Interfaces:
Comparable<AccessControlEntry>,AccessControlEntry
@Generated(from="AccessControlEntry",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableAccessControlEntry
extends Object
implements AccessControlEntry
Immutable implementation of
AccessControlEntry.
Use the builder to create immutable instances:
ImmutableAccessControlEntry.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableAccessControlEntry. -
Field Summary
Fields inherited from interface org.bremersee.acl.model.AccessControlEntry
GROUPS, GUEST, PERMISSION, ROLES, USERS -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableAccessControlEntry.static ImmutableAccessControlEntrycopyOf(AccessControlEntry instance) Creates an immutable copy of aAccessControlEntryvalue.booleanThis instance is equal to all instances ofImmutableAccessControlEntrythat have equal attribute values.Specifies the granted groups.Specifies the permission.getRoles()Specifies the granted roles.getUsers()Specifies the granted users.inthashCode()Computes a hash code from attributes:permission,isGuest,users,roles,groups.booleanisGuest()Specifies whether anybody is granted or not.toString()Prints the immutable valueAccessControlEntrywith attribute values.withGroups(Collection<String> value) Copy the current immutable object by setting a value for thegroupsattribute.withIsGuest(boolean value) Copy the current immutable object by setting a value for theisGuestattribute.withPermission(String value) Copy the current immutable object by setting a value for thepermissionattribute.withRoles(Collection<String> value) Copy the current immutable object by setting a value for therolesattribute.withUsers(Collection<String> value) Copy the current immutable object by setting a value for theusersattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bremersee.acl.model.AccessControlEntry
compareTo
-
Method Details
-
getPermission
Specifies the permission.- Specified by:
getPermissionin interfaceAccessControlEntry- Returns:
- the permission
-
isGuest
public boolean isGuest()Specifies whether anybody is granted or not.- Specified by:
isGuestin interfaceAccessControlEntry- Returns:
- whether anybody is granted (true) or not (false)
-
getUsers
Specifies the granted users.- Specified by:
getUsersin interfaceAccessControlEntry- Returns:
- the users
-
getRoles
Specifies the granted roles.- Specified by:
getRolesin interfaceAccessControlEntry- Returns:
- the roles
-
getGroups
Specifies the granted groups.- Specified by:
getGroupsin interfaceAccessControlEntry- Returns:
- the groups
-
withPermission
Copy the current immutable object by setting a value for thepermissionattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for permission- Returns:
- A modified copy or the
thisobject
-
withIsGuest
Copy the current immutable object by setting a value for theisGuestattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for isGuest- Returns:
- A modified copy or the
thisobject
-
withUsers
Copy the current immutable object by setting a value for theusersattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for users- 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 ofImmutableAccessControlEntrythat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:permission,isGuest,users,roles,groups. -
toString
Prints the immutable valueAccessControlEntrywith attribute values. -
copyOf
Creates an immutable copy of aAccessControlEntryvalue. 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 AccessControlEntry instance
-
builder
Creates a builder forImmutableAccessControlEntry.ImmutableAccessControlEntry.builder() .permission(String) // requiredpermission.isGuest(boolean) // optionalisGuest.users(Collection<String>) // optionalusers.roles(Collection<String>) // optionalroles.groups(Collection<String>) // optionalgroups.build();- Returns:
- A new ImmutableAccessControlEntry builder
-