public class PrincipalCollectionImpl extends Object implements PrincipalCollection
Constructor and Description |
---|
PrincipalCollectionImpl() |
PrincipalCollectionImpl(Collection<Principal> principals) |
Modifier and Type | Method and Description |
---|---|
void |
add(Principal principal)
Adds principal to the internal collection of principals.
|
void |
addAll(Collection<Principal> principal)
Adds principals to the internal collection of principals.
|
void |
clearAll()
removes all principals from the collection.
|
boolean |
contains(Principal principal)
Checks if this collection contains specified principal.
|
boolean |
contains(String name)
Checks if this collection contains principal with the specified name.
|
Principal |
get(String name)
Gets principal associated to the specified name from the collection.
|
Collection<Principal> |
getCollection() |
String |
getName()
Gets name given to this principal.
|
Iterator<Principal> |
iterator()
Returns an iterator over the collection of principals.
|
void |
remove(Principal principal)
Removes principal from the collection if present or does nothing in case principal was not present in the collection.
|
void |
set(Collection<Principal> collection)
Deprecated.
since 4.5
|
void |
setName(String name)
Sets this principal name.
|
String |
toString() |
public PrincipalCollectionImpl()
public PrincipalCollectionImpl(Collection<Principal> principals)
public String getName()
getName
in interface PrincipalCollection
getName
in interface Principal
public void setName(String name)
setName
in interface PrincipalCollection
@Deprecated public void set(Collection<Principal> collection)
set
in interface PrincipalCollection
public void add(Principal principal)
add
in interface PrincipalCollection
principal
- to be added to the collectionpublic void addAll(Collection<Principal> principal)
addAll
in interface PrincipalCollection
principal
- to be added to the collectionpublic void remove(Principal principal)
remove
in interface PrincipalCollection
principal
- to be removed from the collectionpublic void clearAll()
clearAll
in interface PrincipalCollection
public boolean contains(Principal principal)
contains
in interface PrincipalCollection
public boolean contains(String name)
contains
in interface PrincipalCollection
public Principal get(String name)
get
in interface PrincipalCollection
public Collection<Principal> getCollection()
getCollection
in interface PrincipalCollection
public Iterator<Principal> iterator()
iterator
in interface PrincipalCollection
iterator
in interface Iterable<Principal>
Copyright © 2003–2015 Magnolia International Ltd.. All rights reserved.