@Entity
public class Role
extends com.whitestein.lsps.common.VersionedAbstractEntity
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FIND_ALL
Query name.
|
static java.lang.String |
FIND_FOR_PERSON
Query name.
|
Modifier | Constructor and Description |
---|---|
protected |
Role()
Constructor needed for JPA-specific purposes.
|
|
Role(RoleName roleName,
java.util.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(java.lang.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. |
java.lang.String |
getParameter(java.lang.String name)
Returns the value of the parameter that this role contains.
|
java.util.Map<java.lang.String,java.lang.String> |
getParameters()
Returns a collection of parameters that belong to this role.
|
java.lang.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(java.lang.String personId)
Sets the owning personId.
|
java.lang.String |
toString() |
public static final java.lang.String FIND_ALL
public static final java.lang.String FIND_FOR_PERSON
protected Role()
public Role(RoleName roleName, RoleUnitParameter... parameters)
roleName
- parameters
- java.lang.NullPointerException
- if roleName
is null.public Role(RoleName roleName, java.util.Collection<RoleUnitParameter> parameters)
roleName
- parameters
- java.lang.NullPointerException
- if roleName
is nulljava.lang.IllegalArgumentException
- if any parameter in parameters
is not contained in
roleName
public Role(RoleName roleName, RoleUnitName roleUnitName)
roleName
- roleUnitName
- java.lang.NullPointerException
- if roleName
is nulljava.lang.IllegalArgumentException
- 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 java.util.Map<java.lang.String,java.lang.String> getParameters()
public java.lang.String getParameter(java.lang.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.java.lang.NullPointerException
- (unchecked) If the name
argument is null
.public boolean containsParameter(java.lang.String name)
false
.name
- The name of the parameter.true
if the role parameters contain a parameter for given
string name, otherwise returns false
.java.lang.NullPointerException
- (unchecked) If the name
argument is null
.public java.lang.String getPersonId()
public void setPersonId(java.lang.String personId)
personId
- The owning personId. Cannot be null
.java.lang.NullPointerException
- (unchecked) If person
is null
.java.lang.IllegalStateException
- (unchecked) If this role already has owning person.public void removePersonId()
java.lang.IllegalStateException
- (unchecked) If this role has no owning person.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.