public 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(Collection<String> roles) |
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, size, spliteratorequals, hashCode, removeAlladdAll, containsAll, retainAll, toArray, toArrayfinalize, getClass, notify, notifyAll, wait, wait, waitaddAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArrayparallelStream, removeIf, streampublic 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 Roles(Collection<String> roles)
public 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–2020 Apache Software Foundation. All rights reserved.