org.apache.commons.lang
Class ObjectUtils

java.lang.Object
  |
  +--org.apache.commons.lang.ObjectUtils

public class ObjectUtils
extends java.lang.Object

Common Object manipulation routines.

Version:
$Id: ObjectUtils.java,v 1.1 2002/07/19 03:35:54 bayard Exp $
Author:
Nissim Karpenstein, Janek Bogucki, Daniel Rall, Stephen Colebourne

Constructor Summary
private ObjectUtils()
          Prevent construction of ObjectUtils instances
 
Method Summary
static java.lang.Object defaultIfNull(java.lang.Object object, java.lang.Object defaultValue)
          Returns a default value if the object passed is null.
static boolean equals(java.lang.Object object1, java.lang.Object object2)
          Compares two objects for equality, where either one or both objects may be null.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

ObjectUtils

private ObjectUtils()
Prevent construction of ObjectUtils instances
Method Detail

defaultIfNull

public static java.lang.Object defaultIfNull(java.lang.Object object,
                                             java.lang.Object defaultValue)
Returns a default value if the object passed is null.
Parameters:
object - the object to test.
defaultValue - the default value to return.
Returns:
object if it is not null, defaultValue otherwise.

equals

public static boolean equals(java.lang.Object object1,
                             java.lang.Object object2)
Compares two objects for equality, where either one or both objects may be null.
Parameters:
object1 - the first object.
object2 - the second object.
Returns:
True if the values of both objects are the same.


Copyright (c) 2001-2002 - Apache Software Foundation