com.jrefinery.util
Class ObjectUtils

java.lang.Object
  extended by com.jrefinery.util.ObjectUtils

public abstract class ObjectUtils
extends java.lang.Object

Useful static utility methods.

Author:
David Gilbert

Constructor Summary
ObjectUtils()
           
 
Method Summary
static java.util.List clone(java.util.List list)
          Returns a clone of the list.
static java.lang.Object clone(java.lang.Object object)
          Returns a clone of the object, if the object implements the PublicCloneable interface, otherwise the original object reference is returned.
static boolean equal(java.lang.Object o1, java.lang.Object o2)
          Returns true if the two objects are equal OR both null.
static boolean equalOrBothNull(java.lang.Object o1, java.lang.Object o2)
          Deprecated. Use ObjectUtils.equal(...).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectUtils

public ObjectUtils()
Method Detail

equal

public static boolean equal(java.lang.Object o1,
                            java.lang.Object o2)
Returns true if the two objects are equal OR both null.

Parameters:
o1 - object 1.
o2 - object 2.
Returns:
true or false.

clone

public static java.lang.Object clone(java.lang.Object object)
                              throws java.lang.CloneNotSupportedException
Returns a clone of the object, if the object implements the PublicCloneable interface, otherwise the original object reference is returned.

Parameters:
object - the object to clone (null permitted).
Returns:
A clone or the original object reference.
Throws:
java.lang.CloneNotSupportedException - if the object cannot be cloned.

clone

public static java.util.List clone(java.util.List list)
                            throws java.lang.CloneNotSupportedException
Returns a clone of the list. The objects within the list are cloned IF they implement the PublicCloneable interface, otherwise the reference to the original object is retained in the cloned list.

Parameters:
list - the list.
Returns:
A clone of the list.
Throws:
java.lang.CloneNotSupportedException - if the list could not be cloned.

equalOrBothNull

public static boolean equalOrBothNull(java.lang.Object o1,
                                      java.lang.Object o2)
Deprecated. Use ObjectUtils.equal(...).

Returns true if the two objects are equal OR both null.

Parameters:
o1 - object 1.
o2 - object 2.
Returns:
true or false.


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.