Package org.castor.xmlctf
Class CompareHelper
- java.lang.Object
-
- org.castor.xmlctf.CompareHelper
-
public class CompareHelper extends java.lang.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 Summary
Constructors Constructor Description CompareHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
comparePrimitiveArray(java.lang.Object o1, java.lang.Object o2)
Compares two arrays of primitive values.static boolean
equals(java.lang.Object o1, java.lang.Object o2)
Compare two objects.
-
-
-
Method Detail
-
equals
public static boolean equals(java.lang.Object o1, java.lang.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 objecto2
- second object- Returns:
- true if both objects are both null or otherwise are equal
-
comparePrimitiveArray
public static boolean comparePrimitiveArray(java.lang.Object o1, java.lang.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 arrayo2
- The second array- Returns:
- true if the two objects represent arrays of the same primitive values
-
-