T
- the type to set and getpublic class MutableObject<T> extends Object implements Mutable<T>, Serializable
Object
wrapper.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(Object obj)
Compares this object against the specified object.
|
T |
getValue()
Gets the value.
|
int |
hashCode()
Returns the value's hash code or
0 if the value is null . |
void |
setValue(T value)
Sets the value.
|
String |
toString()
Returns the String value of this mutable.
|
public MutableObject()
null
.public MutableObject(T value)
value
- the initial value to storepublic boolean equals(Object obj)
Compares this object against the specified object. The result is true
if and only if the argument
is not null
and is a MutableObject
object that contains the same T
value as this object.
public int hashCode()
0
if the value is null
.Copyright © 2001–2020 The Apache Software Foundation. All rights reserved.