Record Class SecuredVisibility.Requirement
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.components.SecuredVisibility.Requirement
- Record Components:
requiredRoles- roles that must all be present; empty means "no role constraint"requiredPermissions- permissions that must all be present; empty means "no permission constraint"
- Enclosing class:
SecuredVisibility
public static record SecuredVisibility.Requirement(Set<com.svenruppert.jsentinel.authorization.api.roles.RoleName> requiredRoles, Set<com.svenruppert.jsentinel.authorization.api.permissions.PermissionName> requiredPermissions)
extends Record
What a secured component requires to be enabled / visible.
-
Constructor Summary
ConstructorsConstructorDescriptionRequirement(Set<com.svenruppert.jsentinel.authorization.api.roles.RoleName> requiredRoles, Set<com.svenruppert.jsentinel.authorization.api.permissions.PermissionName> requiredPermissions) Validates the components — null becomes empty, sets are defensively copied. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisEmpty()permission(com.svenruppert.jsentinel.authorization.api.permissions.PermissionName permission) Single-permission convenience.Set<com.svenruppert.jsentinel.authorization.api.permissions.PermissionName> Returns the value of therequiredPermissionsrecord component.Set<com.svenruppert.jsentinel.authorization.api.roles.RoleName> Returns the value of therequiredRolesrecord component.role(com.svenruppert.jsentinel.authorization.api.roles.RoleName role) Single-role convenience.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Requirement
-
-
Method Details
-
role
public static SecuredVisibility.Requirement role(com.svenruppert.jsentinel.authorization.api.roles.RoleName role) Single-role convenience. -
permission
public static SecuredVisibility.Requirement permission(com.svenruppert.jsentinel.authorization.api.permissions.PermissionName permission) Single-permission convenience. -
isEmpty
public boolean isEmpty()- Returns:
- true when the requirement carries no constraints
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
requiredRoles
Returns the value of therequiredRolesrecord component.- Returns:
- the value of the
requiredRolesrecord component
-
requiredPermissions
public Set<com.svenruppert.jsentinel.authorization.api.permissions.PermissionName> requiredPermissions()Returns the value of therequiredPermissionsrecord component.- Returns:
- the value of the
requiredPermissionsrecord component
-