au.com.swz.jatlom
Class Utils

java.lang.Object
  extended by au.com.swz.jatlom.Utils

public final class Utils
extends java.lang.Object

A set of static utility methods.

Author:
Mark Richter

Constructor Summary
Utils()
           
 
Method Summary
static boolean areArraysEqual(java.lang.Object[] obj1, java.lang.Object[] obj2)
          Determines if two arrays are equal.
static boolean areObjectsEqual(java.lang.Object obj1, java.lang.Object obj2)
          Determines if two objects are equal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

areObjectsEqual

public static boolean areObjectsEqual(java.lang.Object obj1,
                                      java.lang.Object obj2)
Determines if two objects are equal. The method includes a null check on the objects and if they are both null then they are considered equal. If only one object is null and the other is not then they are NOT equal. If both objects are not null then they are compared using the equals method.

Parameters:
obj1 - the first object to compare for equality.
obj2 - the second object to compare for equality.
Returns:
true if the objects are considered equal as outlined above.

areArraysEqual

public static boolean areArraysEqual(java.lang.Object[] obj1,
                                     java.lang.Object[] obj2)
Determines if two arrays are equal. The method includes a null check on the arrays and if they are both null then they are considered equal. If only one arrayt is null and the other is not then they are NOT equal. If both arrays are not null then their length is compared and if they are idnetical in length then each object in the arrays are compared.

Parameters:
obj1 - the first object to compare for equality.
obj2 - the second object to compare for equality.
Returns:
true if the objects are considered equal as outlined above.