Package org.apache.fulcrum.security.util
Class RoleSet
- All Implemented Interfaces:
Serializable
,Iterable<Role>
,Collection<Role>
,Set<Role>
public class RoleSet extends SecuritySet<Role>
This class represents a set of Roles. It makes it easy to build a UI that
would allow someone to add a group of Roles to a User. It enforces that only
Role objects are allowed in the set and only relevant methods are available.
- Version:
- $Id: RoleSet.java 1845858 2018-11-05 21:14:02Z painter $
- Author:
- John D. McNally, Brett McLaughlin, Marco Knüttel, Henning P. Schmiedehausen
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description RoleSet()
Constructs an empty RoleSetRoleSet(Collection<? extends Role> roles)
Constructs a new RoleSet with specified contents. -
Method Summary
Modifier and Type Method Description Role
getRoleById(Object roleId)
Deprecated.Use getById()Role
getRoleByName(String roleName)
Deprecated.use getByName()String
toString()
Print out a RoleSet as a StringMethods inherited from class org.apache.fulcrum.security.util.SecuritySet
add, add, addAll, clear, contains, containsAll, containsId, containsName, getById, getByName, getIds, getNames, getSet, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
-
Constructor Details
-
RoleSet
public RoleSet()Constructs an empty RoleSet -
RoleSet
Constructs a new RoleSet with specified contents. If the given collection contains multiple objects that are identical WRT equals() method, some objects will be overwritten.- Parameters:
roles
- A collection of roles to be contained in the set.
-
-
Method Details
-
getRoleByName
Deprecated.use getByName()Returns a Role with the given name, if it is contained in this RoleSet.- Parameters:
roleName
- Name of Role.- Returns:
- Role if argument matched a Role in this RoleSet; null if no match.
-
getRoleById
Deprecated.Use getById()Returns a Role with the given id, if it is contained in this RoleSet.- Parameters:
roleId
- id of the Role.- Returns:
- Role if argument matched a Role in this RoleSet; null if no match.
-
toString
Print out a RoleSet as a String- Overrides:
toString
in classSecuritySet<Role>
- Returns:
- The Role Set as String
-