|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.taco.text.AbstractStringToObjectConverter
com.taco.text.StringToBooleanConverter
public final class StringToBooleanConverter
A converter from strings to instances of Boolean
.
Field Summary | |
---|---|
static StringToBooleanConverter |
instance
The singleton instance of this class. |
Method Summary | |
---|---|
java.lang.Object |
toObject(java.lang.String s)
If the string is null or empty, return
Boolean.FALSE . |
Methods inherited from class com.taco.text.AbstractStringToObjectConverter |
---|
map |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final StringToBooleanConverter instance
Method Detail |
---|
public java.lang.Object toObject(java.lang.String s) throws java.text.ParseException
null
or empty, return
Boolean.FALSE
. If the string begins with 't' or 'y',
ignoring case, return Boolean.TRUE
. If the string begins
with 'f' or 'n', return Boolean.FALSE
. Otherwise, throw a
ParseException
. This is slightly unsafe, but very fast.
toObject
in interface IStringToObjectConverter
java.text.ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |