Class SimpleRoleGroup

    • Constructor Detail

      • SimpleRoleGroup

        public SimpleRoleGroup​(String roleName)
      • SimpleRoleGroup

        public SimpleRoleGroup​(Group rolesGroup)
      • SimpleRoleGroup

        public SimpleRoleGroup​(Set<Principal> rolesAsPrincipals)
    • Method Detail

      • getType

        public RoleType getType()
        Description copied from interface: Role
        Get type of role
        Specified by:
        getType in interface Role
        Overrides:
        getType in class SimpleRole
        Returns:
        simple,group
      • addRole

        public void addRole​(Role role)
        Description copied from interface: RoleGroup
        Add a role
        Specified by:
        addRole in interface RoleGroup
      • addAll

        public void addAll​(Collection<Role> roles)
        Description copied from interface: RoleGroup

        Adds all specified roles to the role group.

        Specified by:
        addAll in interface RoleGroup
        Parameters:
        roles - the list of roles to be added.
      • removeRole

        public void removeRole​(Role role)
        Description copied from interface: RoleGroup
        Remove a role
        Specified by:
        removeRole in interface RoleGroup
      • clearRoles

        public void clearRoles()
        Description copied from interface: RoleGroup
        Clear all the roles
        Specified by:
        clearRoles in interface RoleGroup
      • getRoles

        public Collection<Role> getRoles()
        Description copied from interface: RoleGroup

        Get the roles contained in the RoleGroup. The returned List should be unmodifiable as the RoleGroup interface provides methods to add and remove roles.

        Specified by:
        getRoles in interface RoleGroup
        Returns:
        a unmodifiable Collection containing the RoleGroup's roles.
      • containsAll

        public boolean containsAll​(Role anotherRole)
        Description copied from interface: Role
        Indicate whether the argument role is equal or contained depending on the role-type
        Specified by:
        containsAll in interface Role
        Overrides:
        containsAll in class SimpleRole
        Returns:
        true or false
        See Also:
        Role#contains(Role)
      • containsAtleastOneRole

        public boolean containsAtleastOneRole​(RoleGroup anotherRole)
        Description copied from interface: RoleGroup
        Validates whether there is at least one matching role in "anotherRoleGroup"
        Specified by:
        containsAtleastOneRole in interface RoleGroup
        Parameters:
        anotherRole - another role group
        Returns:
      • containsRole

        public boolean containsRole​(Role role)
        Description copied from interface: RoleGroup
        Validates whether a simple role is available
        Specified by:
        containsRole in interface RoleGroup
        Parameters:
        role - simple role
        Returns: