QJCC homepage

biz.chitec.quarterback.util
Class EqualityUtilities

java.lang.Object
  extended bybiz.chitec.quarterback.util.EqualityUtilities

public final class EqualityUtilities
extends java.lang.Object

Some helper methods for the task of checking equality between more complex objects.

Version:
$Id: 651b7d8b4f622eb2209f8a800f4b397662bfcad9 $
Author:
Dirk Hillbrecht 2006. Released under the LGPL.

Constructor Summary
private EqualityUtilities()
           
 
Method Summary
static boolean equals(java.lang.Object o1, java.lang.Object o2)
          Checks equality of the two given objects and handles null and some complex types correctly If one of the two given objects is null, the method returns false if the other isn't.
private static boolean equalsList(java.util.List l1, java.util.List l2)
          Checks equality of two lists by compairing key-value pairs.
private static boolean equalsMap(java.util.Map m1, java.util.Map m2)
          Checks equality of two maps by compairing key-value pairs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EqualityUtilities

private EqualityUtilities()
Method Detail

equals

public static final boolean equals(java.lang.Object o1,
                                   java.lang.Object o2)
Checks equality of the two given objects and handles null and some complex types correctly If one of the two given objects is null, the method returns false if the other isn't. If both are not null, certain types, especially Collection derivates are checked explicitly. As last resort, o1.equals(o2) is called

Parameters:
o1 - First object to compare
o2 - Second object to compare
Returns:
true if both are null or complex type equality check or o1.equals(o2) returns true, false otherwise.

equalsMap

private static final boolean equalsMap(java.util.Map m1,
                                       java.util.Map m2)
Checks equality of two maps by compairing key-value pairs.


equalsList

private static final boolean equalsList(java.util.List l1,
                                        java.util.List l2)
Checks equality of two lists by compairing key-value pairs.


QJCC homepage