public class Role
extends java.lang.Object
implements java.security.Principal
Role instances, you
should try to call Application.getRole(String) method.| Modifier and Type | Field and Description |
|---|---|
static Role |
ALL
Deprecated.
To be removed as it is ambiguous, roles being specific to a
given application.
|
| Constructor and Description |
|---|
Role()
Default constructor.
|
Role(Application application,
java.lang.String name)
Constructor.
|
Role(Application application,
java.lang.String name,
java.lang.String description)
Constructor.
|
Role(java.lang.String name)
Deprecated.
Use
Role(Application, String) instead. |
Role(java.lang.String name,
java.lang.String description)
Deprecated.
Use
Role(Application, String, String) instead. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
static Role |
get(Application application,
java.lang.String name)
Finds an existing role or creates a new one if needed.
|
static Role |
get(Application application,
java.lang.String name,
java.lang.String description)
Finds an existing role or creates a new one if needed.
|
Application |
getApplication()
Returns the parent application.
|
java.util.List<Role> |
getChildRoles()
Returns the modifiable list of child roles.
|
java.lang.String |
getDescription()
Returns the description.
|
java.lang.String |
getName()
Returns the name.
|
int |
hashCode() |
void |
setApplication(Application application)
Sets the parent application.
|
void |
setChildRoles(java.util.List<Role> childRoles)
Sets the modifiable list of child roles.
|
void |
setDescription(java.lang.String description)
Sets the description.
|
void |
setName(java.lang.String name)
Sets the name.
|
java.lang.String |
toString() |
@Deprecated public static final Role ALL
public Role()
Application.getCurrent() method if available or is null.public Role(Application application, java.lang.String name)
application - The parent application or null.name - The name.public Role(Application application, java.lang.String name, java.lang.String description)
application - The parent application or null.name - The name.description - The description.@Deprecated public Role(java.lang.String name)
Role(Application, String) instead.Application.getCurrent() method.name - The name.@Deprecated
public Role(java.lang.String name,
java.lang.String description)
Role(Application, String, String) instead.Application.getCurrent() method.name - The name.description - The description.public static Role get(Application application, java.lang.String name)
application - The parent application.name - The role name to find or create.public static Role get(Application application, java.lang.String name, java.lang.String description)
application - The parent application.name - The role name to find or create.description - The role description if one needs to be created.public boolean equals(java.lang.Object o)
equals in interface java.security.Principalequals in class java.lang.Objectpublic Application getApplication()
public java.util.List<Role> getChildRoles()
public java.lang.String getDescription()
public java.lang.String getName()
getName in interface java.security.Principalpublic int hashCode()
hashCode in interface java.security.PrincipalhashCode in class java.lang.Objectpublic void setApplication(Application application)
application - The parent application.public void setChildRoles(java.util.List<Role> childRoles)
childRoles - A list of child roles.public void setDescription(java.lang.String description)
description - The description.public void setName(java.lang.String name)
name - The name.public java.lang.String toString()
toString in interface java.security.PrincipaltoString in class java.lang.ObjectCopyright © 2005-2024 Restlet.