Package com.storedobject.core
Class Person
java.lang.Object
com.storedobject.core.StoredObject
com.storedobject.core.Person
- All Implemented Interfaces:
Displayable
,StringFiller
,HasContacts
,HasId
,HasName
,HasShortName
,Notifye
,Comparable<Person>
public final class Person
extends StoredObject
implements HasContacts, Comparable<Person>, HasName, HasShortName, Notifye
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addSalutation
(TransactionManager tm, String salutation, boolean male, boolean female, boolean transgender) static void
addSuffix
(TransactionManager tm, String suffix) static String[]
static void
int
static String[]
static Person
int
getAge()
Gets the age of this person as of now.int
Gets the age of this person.getContactObject
(Id contactTypeId) Get the contact value for a specific type of contact.Get the date of birthGet the first name of the personint
Get the gender valueGet the gender value as a String in the local languagestatic String[]
Get the last name of the personint
Get the marital status valueGet the marital status value as a String in the local languagestatic String[]
Get the middle name of the persongetName()
Get the name of the personGet the short name of the personint
Gets the suffix of this person.Gets the suffix value of this person.static String
getSuffixValue
(int suffix) Get the suffix value for the index passed.static String[]
Gets the list of suffix values.int
getTitle()
static String[]
static String[]
getTitleValues
(int gender) Get the title values for a particular gender in the local languagestatic void
static boolean
isFemaleAllowed
(int title) static boolean
isMaleAllowed
(int title) boolean
isMinor()
See if this person is a minorboolean
See if this person is a minor as of a given daystatic boolean
isTransgenderAllowed
(int title) static ObjectIterator
<Person> boolean
notify
(String templateName, TransactionManager tm, Object... messageParameters) Create and send a message to this person.void
setDateOfBirth
(Date dateOfBirth) Set the date of birthvoid
setFirstName
(String name) Set the first name of the personvoid
setGender
(int gender) Set the gender of the person.void
setGenderSpecificTitle
(int index) Sets the title value of this person.void
setLastName
(String name) Set the last name of the personvoid
setMaritalStatus
(int maritalStatus) Set the marital status of the personvoid
setMiddleName
(String name) Set the middle name of the personvoid
Set the name of the personvoid
setShortName
(String name) Set the short name of the personvoid
setSuffix
(int suffix) Sets the suffix.void
setTitle
(int title) Sets the title value of this person.toString()
String representation of the instance.static void
updateSalutation
(TransactionManager tm, int code, String salutation, boolean male, boolean female, boolean transgender) static void
updateSuffix
(TransactionManager tm, int code, String suffix) void
This will be invoked by the system whenever the object is saved to the DB.Methods inherited from class com.storedobject.core.StoredObject
addLink, addLink, addLink, addLink, addLink, addLink, addLink, addLink, checkCurrency, checkCurrency, checkForDuplicate, checkForDuplicate, checkTimeZone, checkTransaction, clearObjectLinks, contemporary, copy, copy, count, count, count, count, count, count, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, create, created, delete, delete, delete, deleted, directUpdate, equals, exists, exists, exists, exists, exists, existsFileData, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsMaster, existsMaster, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, family, family, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getAttachment, getAttachmentId, getChildren, getDeleted, getDeleted, getExistsCondition, getExistsCondition, getFileData, getFileData, getHistorical, getId, getKeyIndex, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getNotExistsCondition, getNotExistsCondition, getParent, getParent, getParent, getParentId, getParentId, getParentId, getRelated, getRelated, getTransaction, getTransactionId, getTransactionIP, getUnique, getUniqueCondition, hashCode, inserted, isModified, isVirtual, list, list, list, list, list, list, list, list, list, list, list, list, list, listFileData, listFileData, listHistory, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listTree, listTree, listTree, listTree, listViaQuery, listViaQuery, load, load, load, load, loaded, loading, makeNew, makeVirtual, migrate, moduleName, nextVersion, objectLink, objectLink, objectLink, objectLinks, objectLinks, old, person, previousVersion, previousVersion, query, query, query, query, query, query, query, query, query, query, query, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, reload, reload, reloaded, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeReverseLinks, removeReverseLinks, save, save, save, save, save, save, save, save, save, save, save, save, save, save, saved, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, toDisplay, transacting, undelete, undelete, undeleted, updated, user, userId, validate, validateChildAttach, validateChildDetach, validateChildUpdate, validateDelete, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, validateUpdate, valueEquals
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.storedobject.core.HasContacts
getAddress, getAddress, getContact, getContact, getContactGroupingCode, getContactObject, getContactObject, getContactOwnerId, getContactRaw, getContactRaw, getEmail, getEmail, getId, getMobile, getPhone, getPhone, getTelegram, listContacts, listContactTypes, setContact, setContact
-
Constructor Details
-
Person
The constructor to create a person- Parameters:
name
- The name of the person (first name, middle name, last name)
-
Person
-
Person
public Person()For internal use only
-
-
Method Details
-
columns
-
indices
-
displayColumns
-
browseColumns
-
getTitleValues
- Returns:
- Returns the title values in the local language
-
getTitleValues
Get the title values for a particular gender in the local language- Parameters:
gender
- The gender value for which title values to be returned- Returns:
- Returns the title values in the local language. Null will be returned if the gender value passed is invalid.
-
getTitleValue
- Returns:
- Returns the title value of this person in the local language
-
getTitle
public int getTitle()- Returns:
- Returns the title of this person
-
setTitle
Sets the title value of this person. Side effect: Setting certain title values may change the gender of the person!- Parameters:
title
- The title value to set- Throws:
Invalid_Value
- If the title value is out-of-range
-
getName
Get the name of the person- Specified by:
getName
in interfaceHasContacts
- Specified by:
getName
in interfaceHasName
- Returns:
- The name of the person as First Name + Middle Name + Last Name
-
setName
Set the name of the person- Parameters:
name
- The name (first name, middle name, last name)
-
setFirstName
Set the first name of the person- Parameters:
name
- The first name
-
getFirstName
-
setMiddleName
Set the middle name of the person- Parameters:
name
- The middle name
-
getMiddleName
-
setLastName
Set the last name of the person- Parameters:
name
- The last name
-
getLastName
-
setShortName
Set the short name of the person- Parameters:
name
- The short name
-
getShortName
Get the short name of the person- Specified by:
getShortName
in interfaceHasShortName
- Returns:
- The short name
-
getSuffixValues
Gets the list of suffix values.- Returns:
- Array of suffix values.
-
getSuffixValue
Get the suffix value for the index passed.- Parameters:
suffix
- Suffix index- Returns:
- The suffix value for the index passed.
-
getSuffixValue
Gets the suffix value of this person.- Returns:
- Suffix value of this person.
-
getSuffix
public int getSuffix()Gets the suffix of this person.- Returns:
- Suffix of this person.
-
setSuffix
public void setSuffix(int suffix) Sets the suffix.- Parameters:
suffix
- Suffix to set.
-
setGenderSpecificTitle
Sets the title value of this person. A gender-specific index is passed as the parameter. This method is useful to pass an index value selected from the array returned by getTitleValues(int gender) method.- Parameters:
index
- Index to the gender-specific title values- Throws:
Invalid_Value
- If the index value is out-of-range- See Also:
-
getGenderValues
- Returns:
- Returns the gender values in the local language
-
setGender
Set the gender of the person. Side effect: Title value may change as per the gender value.- Parameters:
gender
- 0 for Male, 1 for Female, 2 for Transgender- Throws:
Invalid_Value
- If the value is out-of-range
-
getGender
public int getGender()Get the gender value- Returns:
- The gender value. 0 for Male, 1 for Female
-
getGenderValue
Get the gender value as a String in the local language- Returns:
- The gender value as a String
-
setDateOfBirth
Set the date of birth- Parameters:
dateOfBirth
- Date of birth to be set
-
getDateOfBirth
-
isMinor
public boolean isMinor()See if this person is a minor- Returns:
- true if the person is a minor
-
isMinor
See if this person is a minor as of a given day- Parameters:
date
- As of this date.- Returns:
- true if the person is a minor
-
getAge
public int getAge()Gets the age of this person as of now.- Returns:
- Age as of now
-
getAge
Gets the age of this person.- Parameters:
date
- Date as of age is computed.- Returns:
- The age as of the day passed.
-
getMaritalStatusValues
- Returns:
- Returns the marital status values in the local language
-
setMaritalStatus
Set the marital status of the person- Parameters:
maritalStatus
- Marital status value- Throws:
Invalid_Value
- If the value is out-of-range
-
getMaritalStatus
public int getMaritalStatus()Get the marital status value- Returns:
- The marital status value.
-
getMaritalStatusValue
Get the marital status value as a String in the local language- Returns:
- The marital status value as a String
-
toString
Description copied from class:StoredObject
String representation of the instance. Mostly used for logging purposes.- Overrides:
toString
in classStoredObject
- Returns:
- String representation of the instance.
-
validateData
Description copied from class:StoredObject
This will be invoked by the system whenever the object is saved to the DB. It will be invoked in all cases, while creating new objects and updating/deleting/un-deleting existing objects. If any exception is raised by this method, the process of saving to the DB will be abandoned.
Note: This method is mainly used to validate the data of all attributes of the object, and it may be used by others for validating the object. For example, front-end data-entry systems can use this method for validating the object.
- Overrides:
validateData
in classStoredObject
- Parameters:
tm
- Current transaction manager.- Throws:
Exception
- If data is invalid.
-
get
-
list
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Person>
-
addSalutation
public static void addSalutation(TransactionManager tm, String salutation, boolean male, boolean female, boolean transgender) throws Exception - Throws:
Exception
-
updateSalutation
public static void updateSalutation(TransactionManager tm, int code, String salutation, boolean male, boolean female, boolean transgender) throws Exception - Throws:
Exception
-
addSuffix
- Throws:
Exception
-
updateSuffix
- Throws:
Exception
-
isMaleAllowed
public static boolean isMaleAllowed(int title) -
isFemaleAllowed
public static boolean isFemaleAllowed(int title) -
isTransgenderAllowed
public static boolean isTransgenderAllowed(int title) -
notify
Create and send a message to this person.Note: If the template doesn't exist, the default template is used.
-
getContactObject
Description copied from interface:HasContacts
Get the contact value for a specific type of contact.- Specified by:
getContactObject
in interfaceHasContacts
- Parameters:
contactTypeId
- Id of the contact type.- Returns:
- Contact or null if it doesn't exist.
-