public final class Roles extends HashSet<String> implements org.apache.wicket.util.io.IClusterable
| Modifier and Type | Field and Description |
|---|---|
static String |
ADMIN
ADMIN role (for use in annotations)
|
static String |
USER
USER role (for use in annotations)
|
| Constructor and Description |
|---|
Roles()
Construct.
|
Roles(String roles)
Construct.
|
Roles(String[] roles)
Construct.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasAllRoles(Roles roles)
Whether this roles object contains all the provided roles.
|
boolean |
hasAnyRole(Roles roles)
Whether this roles object contains any of the provided roles.
|
boolean |
hasRole(String role)
Whether this roles object containes the provided role.
|
String |
toString() |
add, clear, clone, contains, isEmpty, iterator, remove, sizeequals, hashCode, removeAlladdAll, containsAll, retainAll, toArray, toArraypublic static final String USER
public static final String ADMIN
public Roles()
public Roles(String roles)
roles - Roles as a comma separated list, like "ADMIN, USER"public Roles(String[] roles)
roles - Rolespublic boolean hasRole(String role)
role - the role to checkpublic boolean hasAnyRole(Roles roles)
roles - the roles to checkpublic boolean hasAllRoles(Roles roles)
roles - the roles to checkpublic String toString()
toString in class AbstractCollection<String>Object.toString()Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.