java.lang.Object
org.csveed.bean.conversion.NumberUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Number>
TconvertNumberToTargetClass
(Number number, Class<T> targetClass) Convert number to target class.static <T extends Number>
TparseNumber
(String text, Class<T> targetClass) Parses the number.static <T extends Number>
TparseNumber
(String text, Class<T> targetClass, NumberFormat numberFormat) Parses the number.
-
Method Details
-
convertNumberToTargetClass
public static <T extends Number> T convertNumberToTargetClass(Number number, Class<T> targetClass) throws IllegalArgumentException Convert number to target class.- Type Parameters:
T
- the generic type- Parameters:
number
- the numbertargetClass
- the target class- Returns:
- the t
- Throws:
IllegalArgumentException
- the illegal argument exception
-
parseNumber
-
parseNumber
public static <T extends Number> T parseNumber(String text, Class<T> targetClass, NumberFormat numberFormat) Parses the number.- Type Parameters:
T
- the generic type- Parameters:
text
- the texttargetClass
- the target classnumberFormat
- the number format- Returns:
- the t
-