Package org.apache.commons.lang.mutable
Class MutableBoolean
java.lang.Object
org.apache.commons.lang.mutable.MutableBoolean
- All Implemented Interfaces:
Serializable
,Comparable
,Mutable
@Deprecated(since="2021-04-30")
public class MutableBoolean
extends Object
implements Mutable, Serializable, 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:
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Constructs a new MutableBoolean with the default value of false.MutableBoolean
(boolean value) Deprecated.Constructs a new MutableBoolean with the specified value.MutableBoolean
(Boolean value) Deprecated.Constructs a new MutableBoolean with the specified value. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.Returns the value of this MutableBoolean as a boolean.int
Deprecated.Compares this mutable to another in ascending order.boolean
Deprecated.Compares this object to the specified 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 isfalse
.boolean
isTrue()
Deprecated.Checks if the current value istrue
.void
setValue
(boolean value) Deprecated.Sets the value.void
Deprecated.Sets the value from any Boolean instance.Deprecated.Gets this mutable as an instance of Boolean.toString()
Deprecated.Returns the String value of this mutable.
-
Constructor Details
-
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
Deprecated.Constructs a new MutableBoolean with the specified value.- Parameters:
value
- the initial value to store, not null- Throws:
NullPointerException
- if the object is null
-
-
Method Details
-
getValue
Deprecated.Gets the value as a Boolean instance. -
setValue
public void setValue(boolean value) Deprecated.Sets the value.- Parameters:
value
- the value to set
-
setValue
Deprecated.Sets the value from any Boolean instance.- Specified by:
setValue
in interfaceMutable
- Parameters:
value
- the value to set, not null- Throws:
NullPointerException
- if the object is null
-
isTrue
public boolean isTrue()Deprecated.Checks if the current value istrue
.- Returns:
true
if the current value istrue
- Since:
- 2.5
-
isFalse
public boolean isFalse()Deprecated.Checks if the current value isfalse
.- Returns:
true
if the current value isfalse
- 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
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
Deprecated.Compares this object to the specified object. The result istrue
if and only if the argument is notnull
and is anMutableBoolean
object that contains the sameboolean
value as this object. -
hashCode
public int hashCode()Deprecated.Returns a suitable hash code for this mutable. -
compareTo
Deprecated.Compares this mutable to another in ascending order.- Specified by:
compareTo
in interfaceComparable
- 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
Deprecated.Returns the String value of this mutable.
-