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 voidaddSalutation(TransactionManager tm, String salutation, boolean male, boolean female, boolean transgender) static voidaddSuffix(TransactionManager tm, String suffix) static String[]static voidintstatic String[]static PersonintgetAge()Gets the age of this person as of now.intGets 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 personintGet the gender valueGet the gender value as a String in the local languagestatic String[]Get the last name of the personintGet 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 personintGets the suffix of this person.Gets the suffix value of this person.static StringgetSuffixValue(int suffix) Get the suffix value for the index passed.static String[]Gets the list of suffix values.intgetTitle()static String[]static String[]getTitleValues(int gender) Get the title values for a particular gender in the local languagestatic voidstatic booleanisFemaleAllowed(int title) static booleanisMaleAllowed(int title) booleanisMinor()See if this person is a minorbooleanSee if this person is a minor as of a given daystatic booleanisTransgenderAllowed(int title) static ObjectIterator<Person> booleannotify(String templateName, TransactionManager tm, Object... messageParameters) Create and send a message to this person.voidsetDateOfBirth(Date dateOfBirth) Set the date of birthvoidsetFirstName(String name) Set the first name of the personvoidsetGender(int gender) Set the gender of the person.voidsetGenderSpecificTitle(int index) Sets the title value of this person.voidsetLastName(String name) Set the last name of the personvoidsetMaritalStatus(int maritalStatus) Set the marital status of the personvoidsetMiddleName(String name) Set the middle name of the personvoidSet the name of the personvoidsetShortName(String name) Set the short name of the personvoidsetSuffix(int suffix) Sets the suffix.voidsetTitle(int title) Sets the title value of this person.toString()String representation of the instance.static voidupdateSalutation(TransactionManager tm, int code, String salutation, boolean male, boolean female, boolean transgender) static voidupdateSuffix(TransactionManager tm, int code, String suffix) voidThe system will invoke this 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, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getAttachment, getAttachmentId, getChildren, getContemporaryOf, 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, listDeletedIds, 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, loadAttributesFrom, 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, 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, valueEqualsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
getNamein interfaceHasContacts- Specified by:
getNamein 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:
getShortNamein 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 the 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 the 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:StoredObjectString representation of the instance. Mostly used for logging purposes.- Overrides:
toStringin classStoredObject- Returns:
- String representation of the instance.
-
validateData
Description copied from class:StoredObjectThe system will invoke this whenever the object is saved to the DB. It will be invoked in all cases while creating new objects and updating/deleting/undeleting 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:
validateDatain classStoredObject- Parameters:
tm- Current transaction manager.- Throws:
Exception- If data is invalid.
-
get
-
list
-
compareTo
- Specified by:
compareToin 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:HasContactsGet the contact value for a specific type of contact.- Specified by:
getContactObjectin interfaceHasContacts- Parameters:
contactTypeId- Id of the contact type.- Returns:
- Contact or null if it doesn't exist.
-