@Entity public class SecurityRole extends com.whitestein.lsps.common.VersionedAbstractEntity implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
FIND
Query name.
|
static String |
FIND_ALL
Query name.
|
Modifier | Constructor and Description |
---|---|
protected |
SecurityRole()
Constructor needed for JPA-specific purposes.
|
|
SecurityRole(String name)
Create new
SecurityRole instance with the name property
set to the value given by the name argument. |
Modifier and Type | Method and Description |
---|---|
SecurityRole |
addRight(String rightName)
Adds the right specified be given
rightName argument to the set
of rights that belong to this security role. |
boolean |
equals(Object obj) |
String |
getName()
Returns the name of the security role.
|
Set<String> |
getRights()
Returns a set of rights that are assigned to this security role.
|
int |
hashCode() |
boolean |
hasRight(String right)
Returns
true if this security role has given right
assigned, otherwise returns false . |
Right |
removeRight(String rightName)
Removes the right identified by given
rightName and returns the
Right instance (JPA entity) that has just been removed. |
void |
setName(String name)
Sets the name of the security role.
|
String |
toString() |
public static final String FIND
public static final String FIND_ALL
protected SecurityRole()
public SecurityRole(String name)
SecurityRole
instance with the name
property
set to the value given by the name
argument.name
- The name of the security role. Cannot be blank.NullPointerException
- (unchecked) If the name
argument is null
.IllegalArgumentException
- (unchecked) If the name
argument contains just
whitespace characters.public String getName()
public void setName(String name)
name
- The new name of the security role. Cannot be blank.NullPointerException
- (unchecked) If the name
argument is null
.IllegalArgumentException
- (unchecked) If the name
argument contains just
whitespace characters.public Set<String> getRights()
public boolean hasRight(String right)
true
if this security role has given right
assigned, otherwise returns false
.right
- The name of the right to check for presence.true
if this security role has given right
assigned, otherwise returns false
.public SecurityRole addRight(String rightName)
rightName
argument to the set
of rights that belong to this security role. Returns this
SecurityRole
instance.rightName
- The name of the right to add to the security role.SecurityRole
instance.public Right removeRight(String rightName)
rightName
and returns the
Right
instance (JPA entity) that has just been removed.rightName
- The name of the right to remove from this security role.Right
instance (JPA entity).Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.