org.activemath.webapp.user
Class UserRoleSet

java.lang.Object
  extended by org.activemath.webapp.user.UserRoleSet
All Implemented Interfaces:
Iterable<UserRole>, Collection<UserRole>, Set<UserRole>

public class UserRoleSet
extends Object
implements Set<UserRole>

Container for all user roles a particular user implemements


Field Summary
protected static Logger log
           
 
Constructor Summary
UserRoleSet()
          The default role set contains only the learner role
UserRoleSet(String userRolesCSV)
          Init role set from CSV string of roles.
 
Method Summary
 boolean add(UserRole role)
           
 boolean addAll(Collection<? extends UserRole> c)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 boolean equals(Object o)
           
 Set<UserRole> getRoles()
           
 int hashCode()
           
 boolean isEmpty()
           
 Iterator<UserRole> iterator()
           
 boolean remove(Object o)
           
 void remove(UserRole role)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 void setRoles(Set<UserRole> userRoles)
           
 int size()
           
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static Logger log
Constructor Detail

UserRoleSet

public UserRoleSet()
The default role set contains only the learner role


UserRoleSet

public UserRoleSet(String userRolesCSV)
Init role set from CSV string of roles.

Parameters:
userRolesCSV - CSV representation of the user role set to be created
Method Detail

setRoles

public void setRoles(Set<UserRole> userRoles)

getRoles

public Set<UserRole> getRoles()

toString

public String toString()
Overrides:
toString in class Object
Returns:
CSV representation of the user role set

add

public boolean add(UserRole role)
Specified by:
add in interface Collection<UserRole>
Specified by:
add in interface Set<UserRole>

remove

public void remove(UserRole role)

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<UserRole>
Specified by:
contains in interface Set<UserRole>

addAll

public boolean addAll(Collection<? extends UserRole> c)
Specified by:
addAll in interface Collection<UserRole>
Specified by:
addAll in interface Set<UserRole>

clear

public void clear()
Specified by:
clear in interface Collection<UserRole>
Specified by:
clear in interface Set<UserRole>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<UserRole>
Specified by:
containsAll in interface Set<UserRole>

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection<UserRole>
Specified by:
equals in interface Set<UserRole>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<UserRole>
Specified by:
hashCode in interface Set<UserRole>
Overrides:
hashCode in class Object

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<UserRole>
Specified by:
isEmpty in interface Set<UserRole>

iterator

public Iterator<UserRole> iterator()
Specified by:
iterator in interface Iterable<UserRole>
Specified by:
iterator in interface Collection<UserRole>
Specified by:
iterator in interface Set<UserRole>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<UserRole>
Specified by:
remove in interface Set<UserRole>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<UserRole>
Specified by:
removeAll in interface Set<UserRole>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<UserRole>
Specified by:
retainAll in interface Set<UserRole>

size

public int size()
Specified by:
size in interface Collection<UserRole>
Specified by:
size in interface Set<UserRole>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<UserRole>
Specified by:
toArray in interface Set<UserRole>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<UserRole>
Specified by:
toArray in interface Set<UserRole>