@Immutable public final class AttributeValueConverter extends Object
| Modifier and Type | Method and Description |
|---|---|
static BigDecimal |
getAsBigDecimal(Object aParamName,
Object aValue,
BigDecimal aDefault) |
static BigInteger |
getAsBigInteger(Object aParamName,
Object aValue,
BigInteger aDefault) |
static boolean |
getAsBoolean(Object aParamName,
Object aValue,
boolean bDefault) |
static double |
getAsDouble(Object aParamName,
Object aValue,
double dDefault) |
static float |
getAsFloat(Object aParamName,
Object aValue,
float fDefault) |
static int |
getAsInt(Object aParamName,
Object aValue,
int nDefault) |
static long |
getAsLong(Object aParamName,
Object aValue,
long nDefault) |
static String |
getAsString(Object aParamName,
Object aValue,
String sDefault)
Get the string representation of the passed value, suitable for parameters.
|
@Nullable public static String getAsString(@Nullable Object aParamName, @Nullable Object aValue, @Nullable String sDefault)
aParamName - The name of the parameters. Has just informal character, for
warnings. May be null.aValue - The value to be converted to a String. May be null.
Explicitly supported data types are: String, String[]. All other
data types are returned as "toString()".sDefault - The default value to be returned, if the passed value is
null or an empty String array.null or an empty
String array, the value as string otherwise. If the value is a
String[] than the first element is returned, and the other elements
are discarded.public static int getAsInt(@Nullable Object aParamName, @Nullable Object aValue, int nDefault)
public static long getAsLong(@Nullable Object aParamName, @Nullable Object aValue, long nDefault)
public static double getAsDouble(@Nullable Object aParamName, @Nullable Object aValue, double dDefault)
public static float getAsFloat(@Nullable Object aParamName, @Nullable Object aValue, float fDefault)
public static boolean getAsBoolean(@Nullable Object aParamName, @Nullable Object aValue, boolean bDefault)
@Nullable public static BigInteger getAsBigInteger(@Nullable Object aParamName, @Nullable Object aValue, @Nullable BigInteger aDefault)
@Nullable public static BigDecimal getAsBigDecimal(@Nullable Object aParamName, @Nullable Object aValue, @Nullable BigDecimal aDefault)
Copyright © 2014–2017 Philip Helger. All rights reserved.