Package be.gaudry.model.person
Class Person
java.lang.Object
be.gaudry.model.AbstractLightObject
be.gaudry.model.person.Person
- All Implemented Interfaces:
ILightObject,Serializable
- Since:
- 1.0 Nov 30, 2007, 0.0.4-SNAPSHOT
- Version:
- %I%, %G%
- Author:
- Steph GAUDRY
- See Also:
- Serialized Form
-
Field Summary
FieldsFields inherited from interface be.gaudry.model.ILightObject
DEFAULT_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanIndicates whether some other object is "equal to" this person.Returns a String with the last name and the first name.intgetId()Identifier of the ILightObjectinthashCode()Returns a hash code value for the person.voidsetBirthdate(Date birthdate)voidsetDisplay(String display)Sets the last name by calling thesetLastName(String)method.voidsetFirstName(String firstName)voidvoidsetId(int id)voidsetLastName(String lastName)toString()Builds a string with variables values and the class.
-
Field Details
-
FIND_ALL_QUERY
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Person
public Person() -
Person
- Parameters:
id-lastName-
-
Person
Create a person with only a lastName and a firstName. Person id has -1 value- Parameters:
lastName-firstName-
-
-
Method Details
-
getId
public int getId()Description copied from interface:ILightObjectIdentifier of the ILightObject- Returns:
- the id
-
setId
public void setId(int id)- Parameters:
id- the id to set- See Also:
ILightObject.getId()
-
copy
-
getDisplay
Returns a String with the last name and the first name.- Returns:
- the display
-
setDisplay
Sets the last name by calling thesetLastName(String)method.- Parameters:
display- String representation of the object- See Also:
Person(int, String)
-
equals
Indicates whether some other object is "equal to" this person. \nCheck is done on following fields :- id
- fields checked into the
AbstractLightObjectequalsmethod - fields checked into the
Identityequalsmethod
- Overrides:
equalsin classAbstractLightObject- Parameters:
obj- the reference object with which to compare.- Returns:
trueif this person is the same as the obj argument;falseotherwise.- See Also:
Object.equals(java.lang.Object),hashCode()
-
hashCode
public int hashCode()Returns a hash code value for the person.
Hash is done on following fields :- Overrides:
hashCodein classAbstractLightObject- Returns:
- a hash code value for this person.
- See Also:
Object.hashCode(),equals(Object)
-
toString
Description copied from class:AbstractLightObjectBuilds a string with variables values and the class.- Overrides:
toStringin classAbstractLightObject- Returns:
- a String representation of this LightObject only for debugging
- See Also:
Object.toString()
-
getBirthdate
-
getFirstName
-
getLastName
-
getGender
-
setBirthdate
-
setFirstName
-
setLastName
-
setGender
-