public class NumberUtils
extends org.apache.commons.lang.math.NumberUtils
NumberUtils
contains useful methods for manipulating numbers.Modifier and Type | Field and Description |
---|---|
static double |
DOUBLE_ERROR |
static float |
FLOAT_ERROR |
static int |
INTEGER_ERROR |
static long |
LONG_ERROR |
BYTE_MINUS_ONE, BYTE_ONE, BYTE_ZERO, DOUBLE_MINUS_ONE, DOUBLE_ONE, DOUBLE_ZERO, FLOAT_MINUS_ONE, FLOAT_ONE, FLOAT_ZERO, INTEGER_MINUS_ONE, INTEGER_ONE, INTEGER_ZERO, LONG_MINUS_ONE, LONG_ONE, LONG_ZERO, SHORT_MINUS_ONE, SHORT_ONE, SHORT_ZERO
Constructor and Description |
---|
NumberUtils() |
Modifier and Type | Method and Description |
---|---|
static <T extends Number> |
convertNumberToTargetClass(Number number,
Class<T> targetClass) |
static <T extends Number> |
parseNumber(String text,
Class<T> targetClass) |
static double |
toDouble(Object obj) |
static double |
toDouble(String str) |
static float |
toFloat(Object obj) |
static float |
toFloat(String str) |
static int |
toInt(Object obj) |
static int |
toInt(String str) |
static long |
toLong(Object obj) |
static long |
toLong(String str) |
compare, compare, createBigDecimal, createBigInteger, createDouble, createFloat, createInteger, createLong, createNumber, isDigits, isNumber, max, max, max, max, max, max, max, max, max, max, max, max, min, min, min, min, min, min, min, min, min, min, min, min, stringToInt, stringToInt, toDouble, toFloat, toInt, toLong
public static final int INTEGER_ERROR
public static final long LONG_ERROR
public static final float FLOAT_ERROR
public static final double DOUBLE_ERROR
public static long toLong(Object obj)
public static int toInt(Object obj)
public static float toFloat(Object obj)
public static double toDouble(Object obj)
public static int toInt(String str)
public static long toLong(String str)
public static float toFloat(String str)
public static double toDouble(String str)
public static <T extends Number> T convertNumberToTargetClass(Number number, Class<T> targetClass) throws IllegalArgumentException
IllegalArgumentException
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.