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, DeepEquality, java.io.Serializable
Direct Known Subclasses:
DentalInsurance, MedicalInsurance

public abstract class Insurance
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable, 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)
          Initialize an Insurance instance.
protected Insurance(long insid, java.lang.String carrier, Employee employee)
          Initialize an Insurance instance.
 
Method Summary
 int compareTo(Insurance 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(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.
 java.lang.String getCarrier()
          Get the insurance carrier.
 Employee getEmployee()
          Get the associated employee.
 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(Employee employee)
          Set the associated employee.
 void setInsid(long insid)
          Set the insurance ID.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, 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)
Initialize an Insurance instance.

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

Insurance

protected Insurance(long insid,
                    java.lang.String carrier,
                    Employee employee)
Initialize 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.

Returns:
the insurance ID.

setInsid

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

Parameters:
insid - The insurance ID value.

getCarrier

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

Returns:
The insurance carrier.

setCarrier

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

Parameters:
carrier - The insurance carrier.

getEmployee

public Employee getEmployee()
Get the associated employee.

Returns:
The employee for this insurance.

setEmployee

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

Parameters:
employee - The associated employee.

deepCompareFields

public 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.

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.

compareTo

public int compareTo(Insurance 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.

equals

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

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 Apache Software Foundation. All Rights Reserved.