Package org.apache.fulcrum.security.util
Class GroupSet
- All Implemented Interfaces:
Serializable
,Iterable<Group>
,Collection<Group>
,Set<Group>
This class represents a set of Groups. It's useful for building
administration UI. It enforces that only Group 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
ConstructorsConstructorDescriptionGroupSet()
Constructs an empty GroupSetGroupSet
(Collection<? extends Group> groups) Constructs a new GroupSet with specified contents. -
Method Summary
Modifier and TypeMethodDescriptiongetGroupById
(Object groupId) Deprecated.Use getById()getGroupByName
(String groupName) Deprecated.Use getByName()toString()
Print out a GroupSet 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
-
GroupSet
public GroupSet()Constructs an empty GroupSet -
GroupSet
Constructs a new GroupSet with specified contents. If the given collection contains multiple objects that are identical WRT equals() method, some objects will be overwritten.- Parameters:
groups
- A collection of groups to be contained in the set.
-
-
Method Details
-
getGroupByName
Deprecated.Use getByName()Returns a Group with the given name, if it is contained in this GroupSet.- Parameters:
groupName
- Name of Group.- Returns:
- Group if argument matched a Group in this GroupSet; null if no match.
-
getGroupById
Deprecated.Use getById()Returns a Group with the given id, if it is contained in this GroupSet.- Parameters:
groupId
- Id of the group- Returns:
- Group if argument matched a Group in this GroupSet; null if no match.
-
toString
Print out a GroupSet as a String- Overrides:
toString
in classSecuritySet<Group>
- Returns:
- The Group Set as String
-