Class MutableBoolean

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable, Mutable

    @Deprecated(since="2021-04-30")
    public class MutableBoolean
    extends java.lang.Object
    implements Mutable, java.io.Serializable, java.lang.Comparable
    Deprecated.
    Commons Lang 2 is in maintenance mode. Commons Lang 3 should be used instead.
    A mutable boolean wrapper.
    Since:
    2.2
    See Also:
    Boolean, Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      MutableBoolean()
      Deprecated.
      Constructs a new MutableBoolean with the default value of false.
      MutableBoolean​(boolean value)
      Deprecated.
      Constructs a new MutableBoolean with the specified value.
      MutableBoolean​(java.lang.Boolean value)
      Deprecated.
      Constructs a new MutableBoolean with the specified value.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean booleanValue()
      Deprecated.
      Returns the value of this MutableBoolean as a boolean.
      int compareTo​(java.lang.Object obj)
      Deprecated.
      Compares this mutable to another in ascending order.
      boolean equals​(java.lang.Object obj)
      Deprecated.
      Compares this object to the specified object.
      java.lang.Object getValue()
      Deprecated.
      Gets the value as a Boolean instance.
      int hashCode()
      Deprecated.
      Returns a suitable hash code for this mutable.
      boolean isFalse()
      Deprecated.
      Checks if the current value is false.
      boolean isTrue()
      Deprecated.
      Checks if the current value is true.
      void setValue​(boolean value)
      Deprecated.
      Sets the value.
      void setValue​(java.lang.Object value)
      Deprecated.
      Sets the value from any Boolean instance.
      java.lang.Boolean toBoolean()
      Deprecated.
      Gets this mutable as an instance of Boolean.
      java.lang.String toString()
      Deprecated.
      Returns the String value of this mutable.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MutableBoolean

        public MutableBoolean()
        Deprecated.
        Constructs a new MutableBoolean with the default value of false.
      • MutableBoolean

        public MutableBoolean​(boolean value)
        Deprecated.
        Constructs a new MutableBoolean with the specified value.
        Parameters:
        value - the initial value to store
      • MutableBoolean

        public MutableBoolean​(java.lang.Boolean value)
        Deprecated.
        Constructs a new MutableBoolean with the specified value.
        Parameters:
        value - the initial value to store, not null
        Throws:
        java.lang.NullPointerException - if the object is null
    • Method Detail

      • getValue

        public java.lang.Object getValue()
        Deprecated.
        Gets the value as a Boolean instance.
        Specified by:
        getValue in interface Mutable
        Returns:
        the value as a Boolean, never null
      • setValue

        public void setValue​(boolean value)
        Deprecated.
        Sets the value.
        Parameters:
        value - the value to set
      • setValue

        public void setValue​(java.lang.Object value)
        Deprecated.
        Sets the value from any Boolean instance.
        Specified by:
        setValue in interface Mutable
        Parameters:
        value - the value to set, not null
        Throws:
        java.lang.NullPointerException - if the object is null
      • isTrue

        public boolean isTrue()
        Deprecated.
        Checks if the current value is true.
        Returns:
        true if the current value is true
        Since:
        2.5
      • isFalse

        public boolean isFalse()
        Deprecated.
        Checks if the current value is false.
        Returns:
        true if the current value is false
        Since:
        2.5
      • booleanValue

        public boolean booleanValue()
        Deprecated.
        Returns the value of this MutableBoolean as a boolean.
        Returns:
        the boolean value represented by this object.
      • toBoolean

        public java.lang.Boolean toBoolean()
        Deprecated.
        Gets this mutable as an instance of Boolean.
        Returns:
        a Boolean instance containing the value from this mutable, never null
        Since:
        2.5
      • equals

        public boolean equals​(java.lang.Object obj)
        Deprecated.
        Compares this object to the specified object. The result is true if and only if the argument is not null and is an MutableBoolean object that contains the same boolean value as this object.
        Overrides:
        equals in class java.lang.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 a suitable hash code for this mutable.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code returned by Boolean.TRUE or Boolean.FALSE
      • compareTo

        public int compareTo​(java.lang.Object obj)
        Deprecated.
        Compares this mutable to another in ascending order.
        Specified by:
        compareTo in interface java.lang.Comparable
        Parameters:
        obj - the other mutable to compare to, not null
        Returns:
        negative if this is less, zero if equal, positive if greater where false is less than true
      • toString

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