public class NumericUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_FRACTION_DIGITS
When scale is undefined on decima numbers conversions, use this global defined value.
|
| Modifier and Type | Method and Description |
|---|---|
static <T extends Number> |
assignNumericConverter(PropertyMetaModel<T> pmm,
boolean editable,
IConvertable<T> node,
Class<T> type) |
static <T extends Number> |
createNumberConverter(Class<T> type,
NumericPresentation np,
int scale) |
static BigDecimal |
parseBigDecimal(String input,
int scale,
NumericPresentation np) |
static Double |
parseDoubleWrapper(String input,
int scale,
NumericPresentation np) |
static int |
parseInt(String input)
Parse an integer using all allowed embellishments.
|
static Integer |
parseIntWrapper(String input) |
static long |
parseLong(String input) |
static Long |
parseLongWrapper(String input) |
static <T> T |
parseNumber(Class<T> type,
String input)
Deprecated.
|
static <T> T |
parseNumber(Class<T> type,
String input,
int scale)
Parse any supported numeric wrapper type.
|
static <T> T |
parseNumber(Class<T> type,
String input,
int scale,
NumericPresentation np)
Parse any supported numeric wrapper type.
|
static String |
renderNumber(Number v,
NumericPresentation np,
int scale) |
public static final int DEFAULT_FRACTION_DIGITS
public static int parseInt(String input)
input - public static long parseLong(String input)
@Nullable public static Double parseDoubleWrapper(String input, int scale, NumericPresentation np)
@Nullable public static BigDecimal parseBigDecimal(String input, int scale, NumericPresentation np)
@Deprecated @Nullable public static <T> T parseNumber(Class<T> type, String input)
parseNumber(Class, String, int).
Parse any supported numeric wrapper type. In case that any specific scale must be used, use other method parseNumber(Class, String, int, NumericPresentation)T - type - In case of decimal types, it uses scale defined by DEFAULT_FRACTION_DIGITS.input - @Nullable public static <T> T parseNumber(Class<T> type, String input, int scale)
parseNumber(Class, String, int, NumericPresentation)T - type - In case of decimal types, it uses scale defined by DEFAULT_FRACTION_DIGITS.input - @Nullable public static <T> T parseNumber(Class<T> type, String input, int scale, NumericPresentation np)
T - type - input - scale - Integer based types can be used only with scale 0 -> no decimal places allowed here.np - @Nonnull public static String renderNumber(Number v, NumericPresentation np, int scale)
public static <T extends Number> IConverter<T> createNumberConverter(Class<T> type, NumericPresentation np, int scale)
public static <T extends Number> void assignNumericConverter(PropertyMetaModel<T> pmm, boolean editable, IConvertable<T> node, Class<T> type)
Copyright © 2017 etc.to. All rights reserved.