public abstract class SecuritySet<T extends SecurityEntity> extends Object implements Serializable, Set<T>, Iterable<T>
Modifier and Type | Field and Description |
---|---|
protected Map<Object,T> |
idMap
Map for "id" -> "security object"
|
protected Map<String,T> |
nameMap
Map for "name" -> "security object"
|
Constructor and Description |
---|
SecuritySet()
Constructs an empty Set
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Collection<? extends T> collection)
Adds the entities in a Collection to this SecuritySet.
|
boolean |
add(T o) |
boolean |
addAll(Collection<? extends T> collection) |
void |
clear()
Removes all Objects from this Set.
|
boolean |
contains(Object o)
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 Set
|
boolean |
containsName(String name)
Searches if an Object with a given name is in the Set
|
T |
getById(Object id)
Returns an entity with the given id, if it is contained in this
SecuritySet.
|
T |
getByName(String name)
Returns an entity with the given name, if it is contained in this
SecuritySet.
|
Set<Object> |
getIds()
Returns a set of Id values in this Object.
|
Set<String> |
getNames()
Returns a set of Names in this Object.
|
Set<T> |
getSet()
Returns a set of security objects in this object.
|
boolean |
isEmpty() |
Iterator<T> |
iterator()
Returns an Iterator for Objects in this Set.
|
boolean |
remove(Object o)
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) |
String |
toString()
list of role names in this set
|
protected Map<String,T extends SecurityEntity> nameMap
protected Map<Object,T extends SecurityEntity> idMap
public Set<T> getSet()
public Set<String> getNames()
public Set<Object> getIds()
public void clear()
clear
in interface Collection<T extends SecurityEntity>
clear
in interface Set<T extends SecurityEntity>
public boolean containsName(String name)
roleName
- Name of the Security Object.public boolean containsId(Object id)
id
- Id of the Security Object.public Iterator<T> iterator()
iterator
in interface Iterable<T extends SecurityEntity>
iterator
in interface Collection<T extends SecurityEntity>
iterator
in interface Set<T extends SecurityEntity>
public int size()
size
in interface Collection<T extends SecurityEntity>
size
in interface Set<T extends SecurityEntity>
public String toString()
public boolean add(T o)
add
in interface Collection<T extends SecurityEntity>
add
in interface Set<T extends SecurityEntity>
Collection.add(java.lang.Object)
public boolean add(Collection<? extends T> collection)
collection
- A Collection of entities.public boolean addAll(Collection<? extends T> collection)
addAll
in interface Collection<T extends SecurityEntity>
addAll
in interface Set<T extends SecurityEntity>
public boolean isEmpty()
isEmpty
in interface Collection<T extends SecurityEntity>
isEmpty
in interface Set<T extends SecurityEntity>
public boolean containsAll(Collection<?> collection)
containsAll
in interface Collection<T extends SecurityEntity>
containsAll
in interface Set<T extends SecurityEntity>
public boolean removeAll(Collection<?> collection)
removeAll
in interface Collection<T extends SecurityEntity>
removeAll
in interface Set<T extends SecurityEntity>
public boolean retainAll(Collection<?> collection)
retainAll
in interface Collection<T extends SecurityEntity>
retainAll
in interface Set<T extends SecurityEntity>
public Object[] toArray()
toArray
in interface Collection<T extends SecurityEntity>
toArray
in interface Set<T extends SecurityEntity>
public boolean contains(Object o)
contains
in interface Collection<T extends SecurityEntity>
contains
in interface Set<T extends SecurityEntity>
o
- An entity.public boolean remove(Object o)
remove
in interface Collection<T extends SecurityEntity>
remove
in interface Set<T extends SecurityEntity>
o
- An entity.public <A> A[] toArray(A[] a)
toArray
in interface Collection<T extends SecurityEntity>
toArray
in interface Set<T extends SecurityEntity>
public T getByName(String name)
name
- Name of entity.Copyright © 2011-2015 The Apache Software Foundation. All Rights Reserved.