org.apache.jdo.tck.pc.company
Class Insurance

java.lang.Object
  extended byorg.apache.jdo.tck.pc.company.Insurance
All Implemented Interfaces:
java.lang.Comparable, java.util.Comparator, DeepEquality, IInsurance, java.io.Serializable
Direct Known Subclasses:
DentalInsurance, MedicalInsurance

public abstract class Insurance
extends java.lang.Object
implements IInsurance, java.io.Serializable, java.lang.Comparable, java.util.Comparator, DeepEquality

This class represents an insurance carrier selection for a particular Employee.

See Also:
Serialized Form

Nested Class Summary
static class Insurance.Oid
          This class is used to represent the application identifier for the Insurance class.
 
Constructor Summary
protected Insurance()
          This is the JDO-required no-args constructor.
protected Insurance(long insid, java.lang.String carrier)
          Construct an Insurance instance.
protected Insurance(long insid, java.lang.String carrier, IEmployee employee)
          Construct an Insurance instance.
 
Method Summary
static int compare(IInsurance o1, IInsurance o2)
          Compares its two IInsurance arguments for order.
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compare two instances.
 int compareTo(IInsurance other)
          Compares this object with the specified Insurance object for order.
 int compareTo(java.lang.Object o)
          Compares this object with the specified object for order.
 boolean deepCompareFields(java.lang.Object other, EqualityHelper helper)
          Returns true if all the fields of this instance are deep equal to the coresponding fields of the other Object.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 java.lang.String getCarrier()
          Get the insurance carrier.
 IEmployee getEmployee()
          Get the associated employee.
protected  java.lang.String getFieldRepr()
          Returns a String representation of the non-relationship fields.
 long getInsid()
          Get the insurance ID.
 int hashCode()
          Returns a hash code value for the object.
 void setCarrier(java.lang.String carrier)
          Set the insurance carrier.
 void setEmployee(IEmployee employee)
          Set the associated employee.
 void setInsid(long id)
          Set the insurance ID.
 java.lang.String toString()
          Returns a String representation of a Insurance object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Insurance

protected Insurance()
This is the JDO-required no-args constructor.


Insurance

protected Insurance(long insid,
                    java.lang.String carrier)
Construct an Insurance instance.

Parameters:
insid - The insurance instance identifier.
carrier - The insurance carrier.

Insurance

protected Insurance(long insid,
                    java.lang.String carrier,
                    IEmployee employee)
Construct an Insurance instance.

Parameters:
insid - The insurance instance identifier.
carrier - The insurance carrier.
employee - The employee associated with this insurance.
Method Detail

getInsid

public long getInsid()
Get the insurance ID.

Specified by:
getInsid in interface IInsurance
Returns:
the insurance ID.

setInsid

public void setInsid(long id)
Set the insurance ID.

Specified by:
setInsid in interface IInsurance
Parameters:
id - The insurance ID value.

getCarrier

public java.lang.String getCarrier()
Get the insurance carrier.

Specified by:
getCarrier in interface IInsurance
Returns:
The insurance carrier.

setCarrier

public void setCarrier(java.lang.String carrier)
Set the insurance carrier.

Specified by:
setCarrier in interface IInsurance
Parameters:
carrier - The insurance carrier.

getEmployee

public IEmployee getEmployee()
Get the associated employee.

Specified by:
getEmployee in interface IInsurance
Returns:
The employee for this insurance.

setEmployee

public void setEmployee(IEmployee employee)
Set the associated employee.

Specified by:
setEmployee in interface IInsurance
Parameters:
employee - The associated employee.

toString

public java.lang.String toString()
Returns a String representation of a Insurance object.

Returns:
a String representation of a Insurance object.

getFieldRepr

protected java.lang.String getFieldRepr()
Returns a String representation of the non-relationship fields.

Returns:
a String representation of the non-relationship fields.

deepCompareFields

public boolean deepCompareFields(java.lang.Object other,
                                 EqualityHelper helper)
Returns true if all the fields of this instance are deep equal to the coresponding fields of the other Object.

Specified by:
deepCompareFields in interface DeepEquality
Parameters:
other - the object with which to compare.
helper - EqualityHelper to keep track of instances that have already been processed.
Returns:
true if all the fields are deep equal; false otherwise.
Throws:
java.lang.ClassCastException - if the specified instances' type prevents it from being compared to this instance.

compareTo

public int compareTo(java.lang.Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - The Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
java.lang.ClassCastException - - if the specified object's type prevents it from being compared to this Object.

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Compare two instances. This is a method in Comparator.

Specified by:
compare in interface java.util.Comparator

compareTo

public int compareTo(IInsurance other)
Compares this object with the specified Insurance object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Parameters:
other - The Insurance object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified Insurance object.

compare

public static int compare(IInsurance o1,
                          IInsurance o2)
Compares its two IInsurance arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Parameters:
o1 - the first IInsurance object to be compared.
o2 - the second IInsurance object to be compared.
Returns:
a negative integer, zero, or a positive integer as the first object is less than, equal to, or greater than the second object.

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

Specified by:
equals in interface java.util.Comparator
Parameters:
obj - the object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for the object.

Returns:
a hash code value for this object.


Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.