public final class BooleanValue extends Object implements Value, Serializable
| Modifier and Type | Field and Description |
|---|---|
static BooleanValue |
FALSE |
static BooleanValue |
TRUE |
| Constructor and Description |
|---|
BooleanValue(boolean val)
Creates a new boolean value.
|
BooleanValue(Boolean val)
Creates a boolean value (
true or false). |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ValueVisitor valueVisitor)
Performs some processing on a value.
|
ValueBuilder |
asBuilder() |
boolean |
booleanValue()
Returns the Java boolean corresponding to this object.
|
ValueComparator |
compare(Value val)
Returns
ValueComparator.UNKNOWN, as boolean values do not
have a natural order, unless the provided value is a value list, for
which this method tests for membership in the list. |
boolean |
equals(Object obj) |
String |
format(Format format)
Returns a string representing this value, formatted by the
provided
Format. |
Boolean |
getBoolean()
Returns the Java
Boolean corresponding to this object. |
String |
getFormatted()
Returns a string representing this value for display purposes.
|
ValueType |
getType()
Returns this object's type, guaranteed not
null. |
int |
hashCode() |
static BooleanValue |
parse(String str)
Parses a boolean from a string.
|
BooleanValue |
replace()
Returns a value from a cache that is equal to this one, if such a value
exists.
|
String |
toString() |
public static final BooleanValue TRUE
public static final BooleanValue FALSE
public BooleanValue(boolean val)
val - a java boolean.public BooleanValue(Boolean val)
val - a Boolean object. If null, this
BooleanValue object is set to
falsepublic static BooleanValue parse(String str)
str - a string representing a boolean.null if no boolean could be
parsed.public BooleanValue replace()
Valuepublic Boolean getBoolean()
Boolean corresponding to this object.Boolean.TRUE or Boolean.FALSE.public boolean booleanValue()
true or false.public String getFormatted()
ValuegetFormatted in interface ValueString. Guaranteed not null.public String format(Format format)
ValueFormat.format in interface Valueformat - a Format. Passing in a null will
result in the same behavior as Value.getFormatted().String.public ValueType getType()
Valuenull.public void accept(ValueVisitor valueVisitor)
ValueVisitableaccept in interface ValueVisitablepublic ValueComparator compare(Value val)
ValueComparator.UNKNOWN, as boolean values do not
have a natural order, unless the provided value is a value list, for
which this method tests for membership in the list.compare in interface Valueo - a Value.ValueComparator.UNKNOWN, if the provided value is not a
value list. If the provided value is a value list, it returns
ValueComparator.IN if this boolean value is a member and
ValueComparator.NOT_IN if this boolean value is not a member.public ValueBuilder asBuilder()
Copyright © 2012–2018 Emory University. All rights reserved.