public class BooleanParser extends java.lang.Object implements ValueParser<java.lang.Boolean>
| Modifier and Type | Field and Description |
|---|---|
static BooleanParser |
PARSER
Useful static instance of this object to be used when one doesn't want to
generate lots of parsers when one will suffice
|
| Constructor and Description |
|---|
BooleanParser() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
format(java.lang.Boolean value)
Format a value as a string.
|
java.lang.Class<java.lang.Boolean> |
getType()
Returns the
Class of object this ValueParser can handle. |
java.lang.Boolean |
parse(java.lang.String valueString)
Determines the boolean value of the string.
|
public static final BooleanParser PARSER
public java.lang.Class<java.lang.Boolean> getType()
ValueParserClass of object this ValueParser can handle.
The ValueParser.parse(String) method must return objects that are assignable to this type.
The #format(T) method can format any object assignable to this type.
The returned class will be the
exact Class (i.e. not a subclass) of this
ValueParser's typegetType in interface ValueFormatter<java.lang.Boolean>getType in interface ValueParser<java.lang.Boolean>ValueParserpublic java.lang.Boolean parse(java.lang.String valueString)
throws java.lang.IllegalArgumentException,
java.lang.NullPointerException
parse in interface ValueParser<java.lang.Boolean>java.lang.IllegalArgumentExceptionjava.lang.NullPointerExceptionvalueString - The string to parsetrue if valueString is equal to the
string true. Returns false if
valueString is equal to the string false.uk.ac.ed.epcc.safe.accounting.parsers.value.ValueParser#parse(java.lang
.String)public java.lang.String format(java.lang.Boolean value)
ValueParserformat in interface ValueFormatter<java.lang.Boolean>format in interface ValueParser<java.lang.Boolean>value - The object to format