org.apache.commons.lang.mutable
public class MutableBoolean extends Object implements Mutable, Serializable, Comparable
boolean
wrapper.Boolean
,
Serialized FormConstructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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 hashcode for this mutable.
|
void |
setValue(boolean value)
Sets the value.
|
void |
setValue(Object value)
Sets the value from any Boolean instance.
|
String |
toString()
Returns the String value of this mutable.
|
public MutableBoolean()
public MutableBoolean(boolean value)
value
- a value.public MutableBoolean(Boolean value)
value
- a value.NullPointerException
- if the object is nullpublic boolean booleanValue()
public int compareTo(Object obj)
compareTo
in interface Comparable
obj
- the mutable to compare toClassCastException
- if the argument is not a MutableIntpublic 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.public Object getValue()
public int hashCode()
public void setValue(boolean value)
value
- the value to setpublic void setValue(Object value)
setValue
in interface Mutable
value
- the value to setNullPointerException
- if the object is nullClassCastException
- if the type is not a Boolean
Copyright © 2001-2014 - Apache Software Foundation