Package org.apache.fulcrum.security.util
Class PermissionSet
java.lang.Object
org.apache.fulcrum.security.util.SecuritySet<Permission>
org.apache.fulcrum.security.util.PermissionSet
- All Implemented Interfaces:
Serializable
,Iterable<Permission>
,Collection<Permission>
,Set<Permission>
This class represents a set of Permissions. It makes it easy to build a UI
that would allow someone to add a group of Permissions to a Role. It enforces
that only Permission objects are allowed in the set and only relevant methods
are available.
- Version:
- $Id$
- Author:
- John D. McNally, Brett McLaughlin, Marco Knüttel, Henning P. Schmiedehausen
- See Also:
-
Field Summary
Fields inherited from class org.apache.fulcrum.security.util.SecuritySet
idMap, nameMap
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty PermissionSetPermissionSet
(Collection<? extends Permission> permissions) Constructs a new PermissionSet with specified contents. -
Method Summary
Modifier and TypeMethodDescriptiongetPermissionById
(Object permissionId) Deprecated.Use getById()getPermissionByName
(String permissionName) Deprecated.use getByName()toString()
Print out a PermissionSet 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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
equals, hashCode, spliterator
-
Constructor Details
-
PermissionSet
public PermissionSet()Constructs an empty PermissionSet -
PermissionSet
Constructs a new PermissionSet with specified contents. If the given collection contains multiple objects that are identical WRT equals() method, some objects will be overwritten.- Parameters:
permissions
- A collection of permissions to be contained in the set.
-
-
Method Details
-
getPermissionByName
Deprecated.use getByName()Returns a Permission with the given name, if it is contained in this PermissionSet.- Parameters:
permissionName
- Name of Permission.- Returns:
- Permission if argument matched a Permission in this PermissionSet; null if no match.
-
getPermissionById
Deprecated.Use getById()Returns a Permission with the given id, if it is contained in this PermissionSet.- Parameters:
permissionId
- Id of the Permission.- Returns:
- Permission if argument matched a Permission in this PermissionSet; null if no match.
-
toString
Print out a PermissionSet as a String- Overrides:
toString
in classSecuritySet<Permission>
- Returns:
- The Permission Set as String
-