org.apache.commons.lang.mutable

Class MutableObject

public class MutableObject extends Object implements Mutable, Serializable

A mutable Object wrapper.

Since: 2.1

Version: $Id: MutableObject.java 161243 2005-04-14 04:30:28Z ggregory $

Constructor Summary
MutableObject()
Constructs a new MutableObject with the default value of null.
MutableObject(Object value)
Constructs a new MutableObject with the specified value.
Method Summary
booleanequals(Object obj)
Compares this object against the specified object.
ObjectgetValue()
Gets the value.
inthashCode()
Returns the value's hash code or 0 if the value is null.
voidsetValue(Object value)
Sets the value.
StringtoString()
Returns the String value of this mutable.

Constructor Detail

MutableObject

public MutableObject()
Constructs a new MutableObject with the default value of null.

MutableObject

public MutableObject(Object value)
Constructs a new MutableObject with the specified value.

Parameters: value a value.

Method Detail

equals

public 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 Object value as this object.

Parameters: obj the object to compare with.

Returns: true if the objects are the same; false otherwise.

getValue

public Object getValue()
Gets the value.

Returns: the value

hashCode

public int hashCode()
Returns the value's hash code or 0 if the value is null.

Returns: the value's hash code or 0 if the value is null.

setValue

public void setValue(Object value)
Sets the value.

Parameters: value the value to set

toString

public String toString()
Returns the String value of this mutable.

Returns: the mutable value as a string

Copyright © 2001-2005 - Apache Software Foundation