org.exoplatform.commons.utils.secure
Class SecureSet<E>
java.lang.Object
org.exoplatform.commons.utils.secure.SecureSet<E>
- All Implemented Interfaces:
- Iterable<E>, Collection<E>, Set<E>
public class SecureSet<E>
- extends Object
- implements Set<E>
SecureSet is a wrapper over given Set instance providing additional security check.
To be able to modify set, invoking code must have the same permission as given in SecureSet's
constructor or AllPermission.
- Version:
- $Id: SecureSet.java 34360 2009-07-22 23:58:59Z nzamosenchuk $
- Author:
- Nikolay Zamosenchuk
SecureSet
public SecureSet(Permission permission)
- Constructs a SecureSet using new
HashSet inside.
- Parameters:
permission - Permission that will be required for modificaiton.
SecureSet
public SecureSet(Set<E> set,
Permission permission)
- Constructs a SecureSet using new given
Set instance.
- Parameters:
set - Set, to be based onpermission - Permission that will be required for modificaiton.
add
public boolean add(E e)
- Specified by:
add in interface Collection<E>- Specified by:
add in interface Set<E>
addAll
public boolean addAll(Collection<? extends E> elements)
- Specified by:
addAll in interface Collection<E>- Specified by:
addAll in interface Set<E>
clear
public void clear()
- Specified by:
clear in interface Collection<E>- Specified by:
clear in interface Set<E>
contains
public boolean contains(Object o)
- Specified by:
contains in interface Collection<E>- Specified by:
contains in interface Set<E>
containsAll
public boolean containsAll(Collection<?> coll)
- Specified by:
containsAll in interface Collection<E>- Specified by:
containsAll in interface Set<E>
equals
public boolean equals(Object o)
- Specified by:
equals in interface Collection<E>- Specified by:
equals in interface Set<E>- Overrides:
equals in class Object
hashCode
public int hashCode()
- Specified by:
hashCode in interface Collection<E>- Specified by:
hashCode in interface Set<E>- Overrides:
hashCode in class Object
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface Collection<E>- Specified by:
isEmpty in interface Set<E>
iterator
public Iterator<E> iterator()
- Specified by:
iterator in interface Iterable<E>- Specified by:
iterator in interface Collection<E>- Specified by:
iterator in interface Set<E>
remove
public boolean remove(Object o)
- Specified by:
remove in interface Collection<E>- Specified by:
remove in interface Set<E>
removeAll
public boolean removeAll(Collection<?> pds)
- Specified by:
removeAll in interface Collection<E>- Specified by:
removeAll in interface Set<E>
retainAll
public boolean retainAll(Collection<?> pds)
- Specified by:
retainAll in interface Collection<E>- Specified by:
retainAll in interface Set<E>
size
public int size()
- Specified by:
size in interface Collection<E>- Specified by:
size in interface Set<E>
toArray
public Object[] toArray()
- Specified by:
toArray in interface Collection<E>- Specified by:
toArray in interface Set<E>
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray in interface Collection<E>- Specified by:
toArray in interface Set<E>
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2013 eXo Platform SAS. All Rights Reserved.