public class NumberUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsParsableNumbers(Iterable<?> iterable)
Checks if all the elements are parsable number
|
static Integer |
getIntegerFromString(String stringValue)
Gets an integer value from a
String. |
static boolean |
isDecimal(Number numberValue)
Checks if a
Number contains a decimal |
static boolean |
isDecimal(String stringValue)
Checks if a
String represents a number with decimal. |
static boolean |
isInteger(Number numberValue)
Checks if a
Number is an integer |
static boolean |
isInteger(String stringValue)
Checks if a
String represents an integer |
static boolean |
isNumber(Object object)
Checks whether the Object is a valid Java number
|
static double |
parseDouble(Object object)
Converts an Object to a double.
|
static int |
parseInt(Object object)
Converts an Object to a integer.
|
public static Integer getIntegerFromString(String stringValue)
String. If the string contains a representation of
a double value, the decimal places are truncated.stringValue - the string to get the integer valuepublic static boolean isInteger(String stringValue)
String represents an integerstringValue - the string to be checkedpublic static boolean isDecimal(String stringValue)
String represents a number with decimal.stringValue - the string to be checkedpublic static boolean isInteger(Number numberValue)
Number is an integernumberValue - the number to be checkedpublic static boolean isDecimal(Number numberValue)
Number contains a decimalnumberValue - the number to be checkedpublic static int parseInt(Object object)
object - the object to be parsedNumberFormatException - if the object cannot be converted into integerpublic static double parseDouble(Object object)
object - the object to be parsedNumberFormatException - if the object can not be converted into doublepublic static boolean isNumber(Object object)
object - the object to be evaluatedpublic static boolean containsParsableNumbers(Iterable<?> iterable)
iterable - the iterable to be evaluatedCopyright © 2021. All rights reserved.