public class Person extends Object implements PersonEntity, Serializable
Constructor and Description |
---|
Person()
Creates new instance.
|
Person(String loginName)
Creates new
Person instance with no details. |
Person(String id,
String loginName)
Creates new
Person instance with no details. |
Modifier and Type | Method and Description |
---|---|
void |
addRoleUnitName(RoleUnitName role)
Adds a role.
|
boolean |
equals(Object object) |
Set<Person> |
getActivelySubstituted()
Returns a set of all actively substituted persons.
|
Set<Person> |
getActiveSubstitutes()
Returns a set of all active substitutes.
|
String |
getDetail(String name)
Returns the value of a person detail identified by given
name . |
Map<String,String> |
getDetails()
Returns a map of person details.
|
Set<Person> |
getDirectlySubstituted()
Returns a set of all directly substituted persons.
|
Set<Person> |
getDirectSubstitutes()
Returns a set of all direct substitutes.
|
String |
getEmail()
Returns the email of the person.
|
Long |
getEntityVersion()
Returns the entity version.
|
String |
getFirstName()
Returns first name of the person.
|
String |
getFullName()
Returns the full name of the person.
|
String |
getFullNameAndLogin()
Returns "full name (login)"
|
String |
getId()
Returns the id of the person.
|
String |
getLastName()
Returns last name of the person.
|
String |
getLoginAndFullName()
Returns "login (full name)"
|
String |
getLoginName()
Returns the login name of the person.
|
String |
getPhone()
Returns the phone of the person.
|
Set<String> |
getRights()
Rights for the person.
|
Set<RoleUnitName> |
getRoleUnitNames()
Returns a set of this person roles.
|
int |
hashCode() |
boolean |
isActive()
Returns true if this person is active.
|
boolean |
isInRole(RoleUnitName role)
Return true if this person is in the given role, i.e.
|
boolean |
isInRoles(Collection<RoleUnitName> roles)
Returns true if this person is at least in one of the given roles.
|
boolean |
isStrictlyInRole(RoleUnitName role)
Returns true if this person is strictly in the given role, i.e.
|
boolean |
isStrictlyInRoles(Collection<RoleUnitName> roles)
Returns true if this person is strictly at least in one of the given roles.
|
boolean |
isSubstitutionActive()
Returns true if this person has active substitution.
|
void |
removeRoleUnitName(RoleUnitName role)
Removes a role.
|
void |
setActive(boolean active)
Sets the active flag.
|
void |
setActivelySubstituted(Collection<Person> activelySubstituted)
Sets the actively substitutes persons of this person.
|
void |
setActiveSubstitutes(Collection<Person> activeSubstitutes)
Sets the active substitutes of this person.
|
void |
setDetail(String name,
String value)
Sets the detail of the person.
|
void |
setDetails(Map<String,String> details)
Sets the details of this person.
|
void |
setDirectlySubstituted(Collection<Person> directlySubstituted)
Sets the directly substituted persons of this person.
|
void |
setDirectSubstitutes(Collection<Person> directSubstitutes)
Sets the direct substitutes of this person.
|
void |
setEmail(String email)
Sets the email of the person.
|
void |
setEntityVersion(Long entityVersion)
Sets the entity version.
|
void |
setFirstName(String firstName)
Sets the first name of the person.
|
void |
setLastName(String lastName)
Sets the last name of the person.
|
void |
setLoginName(String loginName) |
void |
setPhone(String phone)
Sets the phone of the person.
|
void |
setRights(Set<String> rights)
Sets rights.
|
void |
setRoleUnitNames(Collection<RoleUnitName> roles)
Sets the person roles.
|
void |
setSubstitutionActive(boolean substitutionActive)
Sets the substitution active flag.
|
String |
toString() |
public Person()
public Person(String id, String loginName)
Person
instance with no details.id
- loginName
- NullPointerException
- if loginName
is nullpublic Person(String loginName)
Person
instance with no details.loginName
- NullPointerException
- if loginName
is nullpublic String getId()
getId
in interface EntityWithId<String>
public String getLoginName()
getLoginName
in interface PersonEntity
public void setLoginName(String loginName)
loginName
- the loginName to setpublic Long getEntityVersion()
getEntityVersion
in interface PersonEntity
public void setEntityVersion(Long entityVersion)
entityVersion
- public boolean isActive()
isActive
in interface PersonEntity
public void setActive(boolean active)
active
- public boolean isSubstitutionActive()
isSubstitutionActive
in interface PersonEntity
public void setSubstitutionActive(boolean substitutionActive)
substitutionActive
- public String getFullName()
public String getFirstName()
getFirstName
in interface PersonEntity
public void setFirstName(String firstName)
firstName
- public String getLastName()
getLastName
in interface PersonEntity
public void setLastName(String lastName)
lastName
- public String getEmail()
getEmail
in interface PersonEntity
public void setEmail(String email)
email
- public String getPhone()
getPhone
in interface PersonEntity
public void setPhone(String phone)
phone
- public Map<String,String> getDetails()
getDetails
in interface PersonEntity
public void setDetails(Map<String,String> details)
details
- public String getDetail(String name)
name
.name
- The name of the person detail.name
or null
if
there is no such detail.public void setDetail(String name, String value)
name
- value
- NullPointerException
- if the name
is nullpublic Set<RoleUnitName> getRoleUnitNames()
getRoleUnitNames
in interface PersonEntity
public void setRoleUnitNames(Collection<RoleUnitName> roles)
roles
- public void addRoleUnitName(RoleUnitName role)
role
- NullPointerException
- if the role
is nullpublic void removeRoleUnitName(RoleUnitName role)
role
- public boolean isInRole(RoleUnitName role)
role
- NullPointerException
- if role
is nullpublic boolean isInRoles(Collection<RoleUnitName> roles)
roles
- NullPointerException
- if roles
or any element of roles
is nullisInRole(RoleUnitName)
public boolean isStrictlyInRole(RoleUnitName role)
role
- NullPointerException
- if role
is nullpublic boolean isStrictlyInRoles(Collection<RoleUnitName> roles)
roles
- NullPointerException
- if roles
or any element of roles
is nullisStrictlyInRole(RoleUnitName)
public Set<Person> getDirectSubstitutes()
getDirectSubstitutes
in interface PersonEntity
public void setDirectSubstitutes(Collection<Person> directSubstitutes)
directSubstitutes
- public Set<Person> getDirectlySubstituted()
getDirectlySubstituted
in interface PersonEntity
public void setDirectlySubstituted(Collection<Person> directlySubstituted)
directlySubstituted
- public Set<Person> getActiveSubstitutes()
getActiveSubstitutes
in interface PersonEntity
public void setActiveSubstitutes(Collection<Person> activeSubstitutes)
activeSubstitutes
- public Set<Person> getActivelySubstituted()
getActivelySubstituted
in interface PersonEntity
public void setActivelySubstituted(Collection<Person> activelySubstituted)
activelySubstituted
- public String getLoginAndFullName()
public String getFullNameAndLogin()
public Set<String> getRights()
PersonEntity
getRights
in interface PersonEntity
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.