org.apache.jdo.tck.util
Interface DeepEquality

All Known Implementing Classes:
Address, Company, Department, Insurance, Person, Project

public interface DeepEquality

This DeepEquality interface defines a method indicating whether some other object is "deep equal to" this object.

Two objects are deep equal, if all the fields are deep equal. The sematics of deep equal on the fields depends of the field type:

The EqualityHelper instance passed to the deepEquals method keeps track of instances that have already been processed to avoid endless recursion for cyclic data structures.

Since:
1.1
Author:
Michael Bouschen

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

Method Detail

deepCompareFields

public boolean deepCompareFields(java.lang.Object other,
                                 EqualityHelper helper)
Returns true if all the fields of this instance are deep equal to the corresponding fields of the other Object. This means that all non-relationship fields are equal to the corresponging fields in the other Object, and all relationship fields are deep equal. Recursion is stopped in the equality helper method that compares objects.

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.


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