Package org.esa.snap.core.util
Class ObjectUtils
- java.lang.Object
-
- org.esa.snap.core.util.ObjectUtils
-
public final class ObjectUtils extends Object
This utility class provides several usefulObject
-related methods.All functions have been implemented with extreme caution in order to provide a maximum performance.
- Version:
- $Revision$ $Date$
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
equalObjects(Object object1, Object object2)
Indicates whether the given objects are "equal to" each other.
-
-
-
Method Detail
-
equalObjects
public static boolean equalObjects(Object object1, Object object2)
Indicates whether the given objects are "equal to" each other.This method should be used in place of the
Object.equals
if one ore both arguments can benull
.If both objects are arrays of the same primitive types the comparision is delegated to the corresponding
java.util.Arrays.equals
method.If both objects are object arrays with equal lengths, the method is recursively called for each array element pair. If the first pair is not equal, the method immediately returns
false
.- Parameters:
object1
- the first object, can benull
object2
- the second object, can also benull
- Returns:
true
if this first object equals the second;false
otherwise.- See Also:
Arrays.equals(long[], long[])
-
-