equals()

Compare this business object's attribute values with those in the input business object, including child business objects.

Syntax

-boolean equals(Object inputBusObj)
 

Parameters

inputBusObj
A business object to compare with this business object.

Return values

Returns true if the values of all attributes are the same; otherwise, returns false.

Exceptions

CollaborationException--The equals() method can set the following exception type for this exception:

Notes

This method compares this business object's attribute values with those in the input business object. If the business objects are hierarchical, the comparison includes all attributes in the child business objects.

Note:
Passing in the business object as an Object ensures that this equals() method overrides the Object.equals() method.

In the comparison, a null value is considered equivalent to any value to which it is compared and does not prevent a return of true.

See also

equalsShallow(), equalKeys()

Examples

The following example compares all attributes of order2 to all attributes of order1 and assigns the result of the comparison to the variable areEqual. The comparison includes the attributes of child business objects, if any.

boolean areEqual = order1.equals(order2);
 

Copyright IBM Corp. 1997, 2003