Package org.apache.commons.lang3.mutable
Class MutableObject<T>
java.lang.Object
org.apache.commons.lang3.mutable.MutableObject<T>
- Type Parameters:
T
- the type to set and get
- All Implemented Interfaces:
Serializable
,Mutable<T>
A mutable
Object
wrapper.- Since:
- 2.1
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
Required for serialization support.private T
The mutable value. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new MutableObject with the default value ofnull
.MutableObject
(T value) Constructs a new MutableObject with the specified value. -
Method Summary
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDRequired for serialization support.- See Also:
-
value
The mutable value.
-
-
Constructor Details
-
MutableObject
public MutableObject()Constructs a new MutableObject with the default value ofnull
. -
MutableObject
Constructs a new MutableObject with the specified value.- Parameters:
value
- the initial value to store
-
-
Method Details
-
equals
Compares this object against the specified object. The result istrue
if and only if the argument is notnull
and is aMutableObject
object that contains the sameMutableObject
value as this object. -
getValue
Gets the value. -
hashCode
public int hashCode()Returns the value's hash code or0
if the value isnull
. -
setValue
Sets the value. -
toString
Returns the String value of this mutable.
-