@Entity
public class Role
extends com.whitestein.lsps.common.VersionedAbstractEntity
Modifier and Type | Field and Description |
---|---|
static String |
FIND_ALL
Query name.
|
static String |
FIND_FOR_PERSON
Query name.
|
Modifier | Constructor and Description |
---|---|
protected |
Role()
Constructor needed for JPA-specific purposes.
|
|
Role(RoleName roleName,
Collection<RoleUnitParameter> parameters)
Creates new instance.
|
|
Role(RoleName roleName,
RoleUnitName roleUnitName)
Creates new instance.
|
|
Role(RoleName roleName,
RoleUnitParameter... parameters)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsParameter(String name)
Returns true if the role parameters contain a parameter for given string
name, otherwise returns
false . |
RoleUnitName |
getFullName()
Converts this role into a
RoleUnitName instance and returns
instance. |
String |
getParameter(String name)
Returns the value of the parameter that this role contains.
|
Map<String,String> |
getParameters()
Returns a collection of parameters that belong to this role.
|
String |
getPersonId()
Returns the owning personId.
|
RoleName |
getRoleName()
Returns the
RoleName instance this role is linked to. |
void |
removePersonId()
Removes the owning person.
|
void |
setPersonId(String personId)
Sets the owning personId.
|
String |
toString() |
public static final String FIND_ALL
public static final String FIND_FOR_PERSON
protected Role()
public Role(RoleName roleName, RoleUnitParameter... parameters)
roleName
- parameters
- NullPointerException
- if roleName
is null.public Role(RoleName roleName, Collection<RoleUnitParameter> parameters)
roleName
- parameters
- NullPointerException
- if roleName
is nullIllegalArgumentException
- if any parameter in parameters
is not contained in
roleName
public Role(RoleName roleName, RoleUnitName roleUnitName)
roleName
- roleUnitName
- NullPointerException
- if roleName
is nullIllegalArgumentException
- if any parameter in parameters
is not contained in
roleName
or if roleUnitName
differs in the
role namepublic RoleName getRoleName()
RoleName
instance this role is linked to.RoleName
instance this role is linked to.public RoleUnitName getFullName()
RoleUnitName
instance and returns
instance. Returned RoleUnitName
instance will contain all the
information the role has (i.e. the module name, the local role name, and
the set of parameters, if the role is a parametric one).RoleUnitName
instance.public Map<String,String> getParameters()
public String getParameter(String name)
name
given as an argument.name
- The name of the parameter. Cannot be null
.name
or
null
if the role does not contain such parameter.NullPointerException
- (unchecked) If the name
argument is null
.public boolean containsParameter(String name)
false
.name
- The name of the parameter.true
if the role parameters contain a parameter for given
string name, otherwise returns false
.NullPointerException
- (unchecked) If the name
argument is null
.public String getPersonId()
public void setPersonId(String personId)
personId
- The owning personId. Cannot be null
.NullPointerException
- (unchecked) If person
is null
.IllegalStateException
- (unchecked) If this role already has owning person.public void removePersonId()
IllegalStateException
- (unchecked) If this role has no owning person.Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.