public class Role extends Object implements 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,
String name)
Constructor.
|
Role(Application application,
String name,
String description)
Constructor.
|
Role(String name)
Deprecated.
Use
Role(Application, String) instead. |
Role(String name,
String description)
Deprecated.
Use
Role(Application, String, String) instead. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static Role |
get(Application application,
String name)
Finds an existing role or creates a new one if needed.
|
static Role |
get(Application application,
String name,
String description)
Finds an existing role or creates a new one if needed.
|
Application |
getApplication()
Returns the parent application.
|
List<Role> |
getChildRoles()
Returns the modifiable list of child roles.
|
String |
getDescription()
Returns the description.
|
String |
getName()
Returns the name.
|
int |
hashCode() |
void |
setApplication(Application application)
Sets the parent application.
|
void |
setChildRoles(List<Role> childRoles)
Sets the modifiable list of child roles.
|
void |
setDescription(String description)
Sets the description.
|
void |
setName(String name)
Sets the name.
|
String |
toString() |
@Deprecated public static final Role ALL
public Role()
Application.getCurrent()
method if available or is null.public Role(Application application, String name)
application
- The parent application or null.name
- The name.public Role(Application application, String name, String description)
application
- The parent application or null.name
- The name.description
- The description.@Deprecated public Role(String name)
Role(Application, String)
instead.Application.getCurrent()
method.name
- The name.@Deprecated public Role(String name, String description)
Role(Application, String, String)
instead.Application.getCurrent()
method.name
- The name.description
- The description.public static Role get(Application application, String name)
application
- The parent application.name
- The role name to find or create.public static Role get(Application application, String name, 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(Object o)
public Application getApplication()
public List<Role> getChildRoles()
public String getDescription()
public String getName()
public int hashCode()
public void setApplication(Application application)
application
- The parent application.public void setChildRoles(List<Role> childRoles)
childRoles
- A list of child roles.public void setDescription(String description)
description
- The description.public void setName(String name)
name
- The name.Copyright © 2005–2017. All rights reserved.