Package org.apache.commons.lang.mutable
Class MutableObject
- java.lang.Object
-
- org.apache.commons.lang.mutable.MutableObject
-
- All Implemented Interfaces:
Serializable
,Mutable
public class MutableObject extends Object implements Mutable, Serializable
A mutableObject
wrapper.- Since:
- 2.1
- Version:
- $Id: MutableObject.java 905636 2010-02-02 14:03:32Z niallp $
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MutableObject()
Constructs a new MutableObject with the default value ofnull
.MutableObject(Object value)
Constructs a new MutableObject with the specified value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Compares this object against the specified object.Object
getValue()
Gets the value.int
hashCode()
Returns the value's hash code or0
if the value isnull
.void
setValue(Object value)
Sets the value.String
toString()
Returns the String value of this mutable.
-
-
-
Constructor Detail
-
MutableObject
public MutableObject()
Constructs a new MutableObject with the default value ofnull
.
-
MutableObject
public MutableObject(Object value)
Constructs a new MutableObject with the specified value.- Parameters:
value
- the initial value to store
-
-
Method Detail
-
getValue
public Object getValue()
Gets the value.
-
setValue
public void setValue(Object value)
Sets the value.
-
equals
public boolean equals(Object obj)
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 sameObject
value as this object.
-
hashCode
public int hashCode()
Returns the value's hash code or0
if the value isnull
.
-
-