com.jgoodies.common.base
public final class Objects extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T extends java.io.Serializable> |
deepCopy(T original)
Provides a means to copy objects that do not implement Cloneable.
|
static boolean |
equals(java.lang.Object o1,
java.lang.Object o2)
Checks and answers if the two objects are both
null or equal. |
public static <T extends java.io.Serializable> T deepCopy(T original)
null
, this method just returns null
.T
- the type of the object to be clonedoriginal
- the object to copied, may be null
public static boolean equals(java.lang.Object o1, java.lang.Object o2)
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
o1
- the first object to compareo2
- the second object to comparetrue
if and only if
both objects are null
or equal according to
equals
invoked on the
first objectCopyright © 2009-2012 JGoodies Karsten Lentzsch. All Rights Reserved.