org.openpermis.policy.bean
Class RoleCollection

java.lang.Object
  extended by org.openpermis.policy.bean.RoleCollection
All Implemented Interfaces:
Iterable<Role>

public class RoleCollection
extends Object
implements Iterable<Role>

A read-only collection of roles.

Since:
0.3.0

Field Summary
static RoleCollection EMPTY
          Does not contain any roles.
private  List<Role> roles
           
 
Constructor Summary
RoleCollection(Collection<Role> roles)
          Creates a role collection for the given roles.
 
Method Summary
static RoleCollection create(Collection<Role> roles)
          Creates a new role collection for the specified roles.
 boolean equals(Object obj)
           
 int hashCode()
           
 boolean isEmpty()
          Returns whether this collection is empty.
 Iterator<Role> iterator()
           
 List<Role> toList()
          Returns a list with the roles that this collection contains.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final RoleCollection EMPTY
Does not contain any roles.

Since:
0.3.0

roles

private final List<Role> roles
Since:
0.3.0
Constructor Detail

RoleCollection

public RoleCollection(Collection<Role> roles)
Creates a role collection for the given roles.

Parameters:
roles - a Collection of roles.
Since:
0.3.0
Method Detail

create

public static RoleCollection create(Collection<Role> roles)
Creates a new role collection for the specified roles.

Parameters:
roles - a Collection of roles.
Returns:
a RoleCollection containing exactly the specified roles.
Since:
0.3.0

isEmpty

public boolean isEmpty()
Returns whether this collection is empty.

Returns:
true if the collection contains no roles.
Since:
0.3.0

toList

public List<Role> toList()
Returns a list with the roles that this collection contains.

Returns:
a List of roles. The caller is free to modify the returned list.
Since:
0.3.0

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
Since:
0.3.0

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Since:
0.3.0

iterator

public Iterator<Role> iterator()
Specified by:
iterator in interface Iterable<Role>
Since:
0.3.0


PERMIS Role Based Access Control 0.3.0 (Build 14)
2009/05/08 09:06:22
Copyright (c) 2002-2007 Ergon Informatik AG