com.jgoodies.common.base
Class Objects

java.lang.Object
  extended by com.jgoodies.common.base.Objects

public final class Objects
extends java.lang.Object

Provides static methods that operate on objects.

Version:
$Revision: 1.6 $
Author:
Karsten Lentzsch

Method Summary
static boolean equals(java.lang.Object o1, java.lang.Object o2)
          Checks and answers if the two objects are both null or equal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equals

public static boolean equals(java.lang.Object o1,
                             java.lang.Object o2)
Checks and answers if the two objects are both null or equal.
 Objects.equals(null, null)  == true
 Objects.equals("Hi", "Hi")  == true
 Objects.equals("Hi", null)  == false
 Objects.equals(null, "Hi")  == false
 Objects.equals("Hi", "Ho")  == false
 

Parameters:
o1 - the first object to compare
o2 - the second object to compare
Returns:
boolean true if and only if both objects are null or equal according to equals invoked on the first object


Copyright © 2009-2010 JGoodies Karsten Lentzsch. All Rights Reserved.