public class Converter extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ELEMENT_SEPARATOR |
static String |
KEY_VALUE_SEPARATOR |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
asBoolean(String booleanString) |
static boolean |
asBoolean(String booleanString,
boolean defaultValue) |
static boolean |
asBooleanChecked(String booleanString,
boolean defaultValue) |
static byte[] |
asBytes(String str) |
static double |
asDouble(String str) |
static double |
asDouble(String str,
double defaultValue) |
static double |
asDoubleChecked(String str,
double defaultValue) |
static File |
asFile(String pValue) |
static float |
asFloat(String str) |
static float |
asFloat(String str,
float defaultValue) |
static float[] |
asFloatArray(String value) |
static float |
asFloatChecked(String str,
float defaultValue) |
static int[] |
asIntArray(String value) |
static int |
asInteger(String str) |
static int |
asInteger(String str,
int defaultValue) |
static int |
asIntegerChecked(String str,
int defaultValue) |
static List<String> |
asList(String string) |
static long |
asLong(String str) |
static long |
asLong(String str,
long defaultValue) |
static long |
asLongChecked(String str,
long defaultValue) |
static Map<String,String> |
asMap(String string)
Read a
Map from string. |
static Map<String,Boolean> |
asMapBoolean(String string) |
static String |
asString(String str,
String defaultValue) |
static String[] |
asStringArray(String value) |
static Boolean |
asThreeState(String booleanString) |
static Boolean |
asThreeState(String booleanString,
Boolean defaultValue) |
public static final String ELEMENT_SEPARATOR
public static final String KEY_VALUE_SEPARATOR
public static boolean asBoolean(String booleanString) throws ConverterException
ConverterExceptionpublic static boolean asBoolean(String booleanString, boolean defaultValue)
public static boolean asBooleanChecked(String booleanString, boolean defaultValue) throws ConverterException
ConverterExceptionpublic static byte[] asBytes(String str) throws ConverterException
ConverterExceptionpublic static double asDouble(String str) throws ConverterException
ConverterExceptionpublic static double asDouble(String str, double defaultValue)
public static double asDoubleChecked(String str, double defaultValue) throws ConverterException
ConverterExceptionpublic static File asFile(String pValue) throws ConverterException
ConverterExceptionpublic static float asFloat(String str) throws ConverterException
ConverterExceptionpublic static float asFloat(String str, float defaultValue)
public static float[] asFloatArray(String value)
public static float asFloatChecked(String str, float defaultValue) throws ConverterException
ConverterExceptionpublic static int[] asIntArray(String value)
public static int asInteger(String str) throws ConverterException
ConverterExceptionpublic static int asInteger(String str, int defaultValue)
public static int asIntegerChecked(String str, int defaultValue) throws ConverterException
ConverterExceptionpublic static long asLong(String str) throws ConverterException
ConverterExceptionpublic static long asLong(String str, long defaultValue)
public static long asLongChecked(String str, long defaultValue) throws ConverterException
ConverterExceptionpublic static Map<String,String> asMap(String string)
Map from string.
The string is a ";" separated key/value list.a=b;foo.bar=gnuThe values are plain literals or quoted strings (@see
ReaderTools.readEntry(Reader, char).
The resulting map is "flat" (not nested), even with "." separated keys.
string ::= entry [ ';' entry ]* entry ::= key [ '=' value ] key ::= id [ '.' id ]
string - Mappublic static Boolean asThreeState(String booleanString) throws ConverterException
ConverterExceptionCopyright © 2013 intarsys consulting GmbH. All Rights Reserved.