Package com.jgoodies.common.base
Class Objects
java.lang.Object
com.jgoodies.common.base.Objects
Provides static methods that operate on objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Serializable>
TdeepCopy(T original) Provides a means to copy objects that do not implement Cloneable.static booleanChecks and answers if the two objects are bothnullor equal.
-
Constructor Details
-
Objects
private Objects()
-
-
Method Details
-
deepCopy
Provides a means to copy objects that do not implement Cloneable. Performs a deep copy where the copied object has no references to the original object for any object that implements Serializable. If the original isnull, this method just returnsnull.- Type Parameters:
T- the type of the object to be cloned- Parameters:
original- the object to copied, may benull- Returns:
- the copied object
- Since:
- 1.1.1
-
equals
Checks and answers if the two objects are bothnullor 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 compareo2- the second object to compare- Returns:
- boolean
trueif and only if both objects arenullor equal according toequalsinvoked on the first object
-