Class CompareHelper

java.lang.Object
org.castor.xmlctf.CompareHelper

public class CompareHelper extends Object
Assists in the comparison of objects. This method is used by generated code but is not used within the CTF directly.
Version:
$Revision: 6785 $ $Date: 2003-10-15 09:17:49 -0600 (Wed, 15 Oct 2003) $
Author:
Sebastien Gignoux
  • Constructor Details

    • CompareHelper

      public CompareHelper()
  • Method Details

    • equals

      public static boolean equals(Object o1, Object o2)
      Compare two objects. Return true if they are both null or if they are equal. This comparison method has special handling for arrays: For arrays, each element is compared.

      Warning: We will throw a NullPointerException if any element of either array is null.

      Parameters:
      o1 - first object
      o2 - second object
      Returns:
      true if both objects are both null or otherwise are equal
    • comparePrimitiveArray

      public static boolean comparePrimitiveArray(Object o1, Object o2)
      Compares two arrays of primitive values. The caller should have tested that the two array have the same length and that the component type are equal.
      Parameters:
      o1 - The first array
      o2 - The second array
      Returns:
      true if the two objects represent arrays of the same primitive values