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