boolean wrapper.
This class was created before the introduction of the the java. package and the AtomicBoolean class.
Note that as MutableBoolean does not extend Boolean, it is not treated by String#format(String, Object. as a Boolean parameter.
Boolean, AtomicBoolean
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Required for serialization support. |
| private boolean | value
The mutable value. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | MutableBoolean(final boolean
the initial value to store value)Constructs a new MutableBoolean with the specified value. |
| public | MutableBoolean(final Boolean
the initial value to store, not null value)Constructs a new MutableBoolean with the specified value. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: the boolean value represented by this object.Returns the value of this MutableBoolean as a boolean. |
| public int | Returns: negative if this is less, zero if equal, positive if greater where false is less than truethe other mutable to compare to, not null other)Implements java. Compares this mutable to another in ascending order. |
| public boolean | Returns: true if the objects are the same; false otherwise.the object to compare with, null returns false obj)Overrides java. Compares this object to the specified object. |
| public Boolean | Returns: the value as a Boolean, never null.Implements org.
Deprecated
Use
get().
Gets the value as a Boolean instance. |
| public int | Returns: the hash code returned byBoolean.TRUE or Boolean.FALSEOverrides java. Returns a suitable hash code for this mutable. |
| public boolean | |
| public boolean | |
| public void | |
| public void | |
| public void | setValue(final boolean
the value to set value)Implements org. Sets the value. |
| public void | setValue(final Boolean
the value to set, not null value)Implements org. Sets the value from any Boolean instance. |
| public Boolean | Returns: a Boolean instance containing the value from this mutable, never nullGets this mutable as an instance of Boolean. |
| public String | Returns: the mutable value as a stringOverrides java. Returns the String value of this mutable. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Required for serialization support.
| |
| value | back to summary |
|---|---|
| private boolean value The mutable value. | |
| MutableBoolean | back to summary |
|---|---|
| public MutableBoolean() Constructs a new MutableBoolean with the default value of false. | |
| MutableBoolean | back to summary |
|---|---|
| public MutableBoolean(final boolean value) Constructs a new MutableBoolean with the specified value.
| |
| MutableBoolean | back to summary |
|---|---|
| public MutableBoolean(final Boolean value) Constructs a new MutableBoolean with the specified value.
| |
| booleanValue | back to summary |
|---|---|
| public boolean booleanValue() Returns the value of this MutableBoolean as a boolean.
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(final MutableBoolean other) Implements java. Compares this mutable to another in ascending order.
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Compares this object to the specified object. The result is | |
| getValue | back to summary |
|---|---|
| public Boolean getValue() Implements org. Deprecated Use Gets the value as a Boolean instance.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a suitable hash code for this mutable.
| |
| isFalse | back to summary |
|---|---|
| public boolean isFalse() Checks if the current value is
| |
| isTrue | back to summary |
|---|---|
| public boolean isTrue() Checks if the current value is
| |
| setFalse | back to summary |
|---|---|
| public void setFalse() Sets the value to false.
| |
| setTrue | back to summary |
|---|---|
| public void setTrue() Sets the value to true.
| |
| setValue | back to summary |
|---|---|
| public void setValue(final boolean value) Implements org. Sets the value.
| |
| setValue | back to summary |
|---|---|
| public void setValue(final Boolean value) Implements org. Sets the value from any Boolean instance.
| |
| toBoolean | back to summary |
|---|---|
| public Boolean toBoolean() Gets this mutable as an instance of Boolean.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns the String value of this mutable. | |