T - the type to set and get.public class MutableObject<T> extends java.lang.Object implements Mutable<T>, java.io.Serializable
Object wrapper.
This class was created before the introduction of AtomicReference.
AtomicReference,
Serialized Form| Constructor and Description |
|---|
MutableObject()
Constructs a new MutableObject with the default value of
null. |
MutableObject(T value)
Constructs a new MutableObject with the specified value.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Compares this object against the specified object.
|
T |
getValue()
Deprecated.
Use
Mutable.get(). |
int |
hashCode()
Returns the value's hash code or
0 if the value is null. |
void |
setValue(T value)
Sets the value.
|
java.lang.String |
toString()
Returns the String value of this mutable.
|
public MutableObject()
null.public MutableObject(T value)
value - the initial value to store.public boolean equals(java.lang.Object obj)
true if and only if the argument
is not null and is a MutableObject object that contains the same T
value as this object.equals in class java.lang.Objectobj - the object to compare with, null returns false.true if the objects are the same;
true if the objects have equivalent value fields;
false otherwise.@Deprecated public T getValue()
Mutable.get().public int hashCode()
0 if the value is null.hashCode in class java.lang.Object0 if the value is null.public void setValue(T value)
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2010 - 2025 Adobe. All Rights Reserved