Package org.apache.fulcrum.security.util
Klasse SecuritySet<T extends SecurityEntity>
java.lang.Object
org.apache.fulcrum.security.util.SecuritySet<T>
- Alle implementierten Schnittstellen:
Serializable
,Iterable<T>
,Collection<T>
,Set<T>
- Bekannte direkte Unterklassen:
GroupSet
,PermissionSet
,RoleSet
,UserSet
public abstract class SecuritySet<T extends SecurityEntity>
extends Object
implements Serializable, Set<T>, Iterable<T>
This class represents a set of Security Entities. It makes it easy to build a
UI. It wraps a TreeSet object to enforce that only relevant methods are
available. TreeSet's contain only unique Objects (no duplicates) based on the
ID. They may or may not have a name, that depends on the implementation. Want
to get away from requiring an ID and a name... Nothing should force Name to
be unique in the basic architecture of Fulcrum Security.
- Version:
- $Id$
- Autor:
- Eric Pugh, John D. McNally, Brett McLaughlin, Marco Knüttel, Henning P. Schmiedehausen
- Siehe auch:
-
Feldübersicht
Felder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
add
(Collection<? extends T> collection) Adds the entities in a Collection to this SecuritySet.boolean
boolean
addAll
(Collection<? extends T> collection) void
clear()
Removes all Objects from this Set.boolean
Checks whether this SecuritySet contains an entity.boolean
containsAll
(Collection<?> collection) boolean
containsId
(Object id) Searches if an Object with a given Id is in the Setboolean
containsName
(String name) Searches if an Object with a given name is in the SetReturns an entity with the given id, if it is contained in this SecuritySet.Returns an entity with the given name, if it is contained in this SecuritySet.getIds()
Returns a set of Id values in this Object.getNames()
Returns a set of Names in this Object.getSet()
Returns a set of security objects in this object.boolean
isEmpty()
iterator()
Returns an Iterator for Objects in this Set.boolean
Removes an entity from this SecuritySet.boolean
removeAll
(Collection<?> collection) boolean
retainAll
(Collection<?> collection) int
size()
Returns size (cardinality) of this set.Object[]
toArray()
<A> A[]
toArray
(A[] a) toString()
list of role names in this setVon Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden java.util.Collection
parallelStream, removeIf, stream, toArray
Von Schnittstelle geerbte Methoden java.util.Set
equals, hashCode, spliterator
-
Felddetails
-
nameMap
Map for "name" is "security object" -
idMap
Map for "id" is "security object"
-
-
Konstruktordetails
-
SecuritySet
public SecuritySet()Constructs an empty Set
-
-
Methodendetails
-
getSet
Returns a set of security objects in this object.- Gibt zurück:
- A Set Object
-
getNames
Returns a set of Names in this Object.- Gibt zurück:
- The Set of Names in this Object, backed by the actual data.
-
getIds
Returns a set of Id values in this Object.- Gibt zurück:
- The Set of Ids in this Object, backed by the actual data.
-
clear
public void clear()Removes all Objects from this Set.- Angegeben von:
clear
in SchnittstelleCollection<T extends SecurityEntity>
- Angegeben von:
clear
in SchnittstelleSet<T extends SecurityEntity>
-
containsName
Searches if an Object with a given name is in the Set- Parameter:
name
- Name of the Security Object.- Gibt zurück:
- True if argument matched an Object in this Set; false if no match.
-
containsId
Searches if an Object with a given Id is in the Set- Parameter:
id
- Id of the Security Object.- Gibt zurück:
- True if argument matched an Object in this Set; false if no match.
-
iterator
Returns an Iterator for Objects in this Set.- Angegeben von:
iterator
in SchnittstelleCollection<T extends SecurityEntity>
- Angegeben von:
iterator
in SchnittstelleIterable<T extends SecurityEntity>
- Angegeben von:
iterator
in SchnittstelleSet<T extends SecurityEntity>
- Gibt zurück:
- An iterator for the Set
-
size
public int size()Returns size (cardinality) of this set.- Angegeben von:
size
in SchnittstelleCollection<T extends SecurityEntity>
- Angegeben von:
size
in SchnittstelleSet<T extends SecurityEntity>
- Gibt zurück:
- The cardinality of this Set.
-
toString
list of role names in this set -
add
- Angegeben von:
add
in SchnittstelleCollection<T extends SecurityEntity>
- Angegeben von:
add
in SchnittstelleSet<T extends SecurityEntity>
- Siehe auch:
-
add
Adds the entities in a Collection to this SecuritySet.- Parameter:
collection
- A Collection of entities.- Gibt zurück:
- True if this Set changed as a result; false if no change to this Set occurred (this Set already contained all members of the added Set).
-
addAll
- Angegeben von:
addAll
in SchnittstelleCollection<T extends SecurityEntity>
- Angegeben von:
addAll
in SchnittstelleSet<T extends SecurityEntity>
-
isEmpty
public boolean isEmpty()- Angegeben von:
isEmpty
in SchnittstelleCollection<T extends SecurityEntity>
- Angegeben von:
isEmpty
in SchnittstelleSet<T extends SecurityEntity>
-
containsAll
- Angegeben von:
containsAll
in SchnittstelleCollection<T extends SecurityEntity>
- Angegeben von:
containsAll
in SchnittstelleSet<T extends SecurityEntity>
-
removeAll
- Angegeben von:
removeAll
in SchnittstelleCollection<T extends SecurityEntity>
- Angegeben von:
removeAll
in SchnittstelleSet<T extends SecurityEntity>
-
retainAll
- Angegeben von:
retainAll
in SchnittstelleCollection<T extends SecurityEntity>
- Angegeben von:
retainAll
in SchnittstelleSet<T extends SecurityEntity>
-
toArray
- Angegeben von:
toArray
in SchnittstelleCollection<T extends SecurityEntity>
- Angegeben von:
toArray
in SchnittstelleSet<T extends SecurityEntity>
-
contains
Checks whether this SecuritySet contains an entity.- Angegeben von:
contains
in SchnittstelleCollection<T extends SecurityEntity>
- Angegeben von:
contains
in SchnittstelleSet<T extends SecurityEntity>
- Parameter:
o
- An entity.- Gibt zurück:
- True if this Set contains the entity, false otherwise.
-
remove
Removes an entity from this SecuritySet.- Angegeben von:
remove
in SchnittstelleCollection<T extends SecurityEntity>
- Angegeben von:
remove
in SchnittstelleSet<T extends SecurityEntity>
- Parameter:
o
- An entity.- Gibt zurück:
- True if this Set contained the entity before it was removed.
-
toArray
public <A> A[] toArray(A[] a) - Angegeben von:
toArray
in SchnittstelleCollection<T extends SecurityEntity>
- Angegeben von:
toArray
in SchnittstelleSet<T extends SecurityEntity>
-
getByName
Returns an entity with the given name, if it is contained in this SecuritySet.- Parameter:
name
- Name of entity.- Gibt zurück:
- entity if argument matched an entity in this Set; null if no match.
-
getById
Returns an entity with the given id, if it is contained in this SecuritySet.- Parameter:
id
- ID of entity.- Gibt zurück:
- entity if argument matched an entity in this Set; null if no match.
-