|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.lang.mutable.MutableBoolean
public class MutableBoolean
A mutable boolean
wrapper.
Boolean
,
Serialized FormConstructor Summary | |
---|---|
MutableBoolean()
Constructs a new MutableBoolean with the default value of false. |
|
MutableBoolean(boolean value)
Constructs a new MutableBoolean with the specified value. |
|
MutableBoolean(Boolean value)
Constructs a new MutableBoolean with the specified value. |
Method Summary | |
---|---|
boolean |
booleanValue()
Returns the value of this MutableBoolean as a boolean. |
int |
compareTo(Object obj)
Compares this mutable to another in ascending order. |
boolean |
equals(Object obj)
Compares this object to the specified object. |
Object |
getValue()
Gets the value as a Boolean instance. |
int |
hashCode()
Returns a suitable hash code for this mutable. |
boolean |
isFalse()
Checks if the current value is false . |
boolean |
isTrue()
Checks if the current value is true . |
void |
setValue(boolean value)
Sets the value. |
void |
setValue(Object value)
Sets the value from any Boolean instance. |
Boolean |
toBoolean()
Gets this mutable as an instance of Boolean. |
String |
toString()
Returns the String value of this mutable. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MutableBoolean()
public MutableBoolean(boolean value)
value
- the initial value to storepublic MutableBoolean(Boolean value)
value
- the initial value to store, not null
NullPointerException
- if the object is nullMethod Detail |
---|
public Object getValue()
getValue
in interface Mutable
public void setValue(boolean value)
value
- the value to setpublic void setValue(Object value)
setValue
in interface Mutable
value
- the value to set, not null
NullPointerException
- if the object is nullpublic boolean isTrue()
true
.
true
if the current value is true
public boolean isFalse()
false
.
true
if the current value is false
public boolean booleanValue()
public Boolean toBoolean()
public boolean equals(Object obj)
true
if and only if the argument is
not null
and is an MutableBoolean
object that contains the same
boolean
value as this object.
equals
in class Object
obj
- the object to compare with, null returns false
true
if the objects are the same; false
otherwise.public int hashCode()
hashCode
in class Object
Boolean.TRUE
or Boolean.FALSE
public int compareTo(Object obj)
compareTo
in interface Comparable
obj
- the other mutable to compare to, not null
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |