Class MutableObject

java.lang.Object
org.apache.commons.lang.mutable.MutableObject
All Implemented Interfaces:
Serializable, Mutable

@Deprecated(since="2021-04-30") public class MutableObject extends Object implements Mutable, Serializable
Deprecated.
Commons Lang 2 is in maintenance mode. Commons Lang 3 should be used instead.
A mutable Object wrapper.
Since:
2.1
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
    Constructs a new MutableObject with the default value of null.
    Deprecated.
    Constructs a new MutableObject with the specified value.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Deprecated.
    Compares this object against the specified object.
    Deprecated.
    Gets the value.
    int
    Deprecated.
    Returns the value's hash code or 0 if the value is null.
    void
    Deprecated.
    Sets the value.
    Deprecated.
    Returns the String value of this mutable.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MutableObject

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

      public MutableObject(Object value)
      Deprecated.
      Constructs a new MutableObject with the specified value.
      Parameters:
      value - the initial value to store
  • Method Details

    • getValue

      public Object getValue()
      Deprecated.
      Gets the value.
      Specified by:
      getValue in interface Mutable
      Returns:
      the value, may be null
    • setValue

      public void setValue(Object value)
      Deprecated.
      Sets the value.
      Specified by:
      setValue in interface Mutable
      Parameters:
      value - the value to set
    • equals

      public boolean equals(Object obj)
      Deprecated.
      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.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare with, null returns false
      Returns:
      true if the objects are the same; false otherwise.
    • hashCode

      public int hashCode()
      Deprecated.
      Returns the value's hash code or 0 if the value is null.
      Overrides:
      hashCode in class Object
      Returns:
      the value's hash code or 0 if the value is null.
    • toString

      public String toString()
      Deprecated.
      Returns the String value of this mutable.
      Overrides:
      toString in class Object
      Returns:
      the mutable value as a string