|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.tck.pc.company.Person
This class represents a person.
Nested Class Summary | |
static class |
Person.Oid
This class is used to represent the application identifier for the Person class. |
Field Summary | |
protected static java.text.SimpleDateFormat |
formatter
|
Constructor Summary | |
protected |
Person()
This is the JDO-required no-args constructor. |
|
Person(long personid,
java.lang.String firstname,
java.lang.String lastname,
java.lang.String middlename,
java.util.Date birthdate,
Address address)
Initialize a Person instance. |
Method Summary | |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
int |
compareTo(Person other)
Compares this object with the specified Person object for order. |
boolean |
deepCompareFields(DeepEquality other,
EqualityHelper helper)
Returns true if all the fields of this instance are
deep equal to the coresponding fields of the specified Person. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. |
Address |
getAddress()
Get the address. |
java.util.Date |
getBirthdate()
Get the person's birthdate. |
java.lang.String |
getFirstname()
Get the person's first name. |
java.lang.String |
getLastname()
Get the person's last name. |
java.lang.String |
getMiddlename()
Get the person's middle name. |
long |
getPersonid()
Get the person's id. |
java.lang.String |
getPhoneNumber(java.lang.String type)
Get the phone number for the specified phone number type. |
java.util.Map |
getPhoneNumbers()
Get the map of phone numbers as an unmodifiable map. |
int |
hashCode()
Returns a hash code value for the object. |
java.lang.String |
putPhoneNumber(java.lang.String type,
java.lang.String phoneNumber)
Associates the specified phone number with the specified type in the map of phone numbers of this person. |
java.lang.String |
removePhoneNumber(java.lang.String type)
Remove a phoneNumber from the map of phone numbers. |
void |
setAddress(Address address)
Set the address. |
void |
setBirthdate(java.util.Date birthdate)
Set the person's birthdate. |
void |
setFirstname(java.lang.String firstname)
Set the person's first name. |
void |
setLastname(long personid)
Set the person's id. |
void |
setLastname(java.lang.String lastname)
Set the person's last name. |
void |
setMiddlename(java.lang.String middlename)
Set the person's middle name. |
void |
setPhoneNumbers(java.util.Map phoneNumbers)
Set the phoneNumber map to be in this person. |
java.lang.String |
toString()
Return a String representation of a Person object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static java.text.SimpleDateFormat formatter
Constructor Detail |
protected Person()
public Person(long personid, java.lang.String firstname, java.lang.String lastname, java.lang.String middlename, java.util.Date birthdate, Address address)
Person
instance.
personid
- The person identifier.firstname
- The person's first name.lastname
- The person's last name.middlename
- The person's middle name.birthdate
- The person's birthdate.address
- The person's address.Method Detail |
public long getPersonid()
public void setLastname(long personid)
personid
- The personid.public java.lang.String getLastname()
public void setLastname(java.lang.String lastname)
lastname
- The last name.public java.lang.String getFirstname()
public void setFirstname(java.lang.String firstname)
firstname
- The first name.public java.lang.String getMiddlename()
public void setMiddlename(java.lang.String middlename)
middlename
- The middle name.public Address getAddress()
public void setAddress(Address address)
address
- The address.public java.util.Date getBirthdate()
public void setBirthdate(java.util.Date birthdate)
birthdate
- The person's birthdate.public java.util.Map getPhoneNumbers()
public java.lang.String getPhoneNumber(java.lang.String type)
type
- The phone number type ("home", "work", "mobile", etc.).
null
if there was no phone number for the type.public java.lang.String putPhoneNumber(java.lang.String type, java.lang.String phoneNumber)
type
- The phone number type ("home", "work", "mobile", etc.).phoneNumber
- The phone number
null
if there was no phone number for the type.public java.lang.String removePhoneNumber(java.lang.String type)
type
- The phone number type ("home", "work", "mobile", etc.).
null
if there was no phone number for the type.public void setPhoneNumbers(java.util.Map phoneNumbers)
phoneNumbers
- The map of phoneNumbers for this person.public java.lang.String toString()
Person
object.
public boolean deepCompareFields(DeepEquality other, EqualityHelper helper)
true
if all the fields of this instance are
deep equal to the coresponding fields of the specified Person.
deepCompareFields
in interface DeepEquality
other
- the object with which to compare.helper
- EqualityHelper to keep track of instances that have
already been processed.
true
if all the fields are deep equal;
false
otherwise.
java.lang.ClassCastException
- if the specified instances' type prevents
it from being compared to this instance.public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- The Object to be compared.
java.lang.ClassCastException
- - if the specified object's type prevents
it from being compared to this Object.public int compareTo(Person other)
other
- The Person object to be compared.
public boolean equals(java.lang.Object obj)
obj
- the object with which to compare.
true
if this object is the same as the obj
argument; false
otherwise.public int hashCode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |