Package pers.neige.neigeitems.utils
Class NumberParser
-
- All Implemented Interfaces:
public class NumberParser
-
-
Constructor Summary
Constructors Constructor Description NumberParser()
-
Method Summary
Modifier and Type Method Description static booleanisIntegerString(@NonNull() String string)判断一段文本是否为朴素的十进制整数文本 static booleanisDecimalString(@NonNull() String string)判断一段文本是否为朴素的十进制小数文本 static ByteparseByte(@NonNull() String string)非正常格式则返回 null, 超限则返回对应侧最大值 static byteparseByte(@NonNull() String string, byte def)非正常格式则返回 def, 超限则返回对应侧最大值 static ShortparseShort(@NonNull() String string)非正常格式则返回 null, 超限则返回对应侧最大值 static shortparseShort(@NonNull() String string, short def)非正常格式则返回 def, 超限则返回对应侧最大值 static IntegerparseInteger(@NonNull() String string)非正常格式则返回 null, 超限则返回对应侧最大值 static intparseInteger(@NonNull() String string, int def)非正常格式则返回 def, 超限则返回对应侧最大值 static LongparseLong(@NonNull() String string)非正常格式则返回 null, 超限则返回对应侧最大值 static longparseLong(@NonNull() String string, long def)非正常格式则返回 def, 超限则返回对应侧最大值 static BigIntegerparseBigInteger(@NonNull() String string)非正常格式则返回 null static BigIntegerparseBigInteger(@NonNull() String string, @NonNull() BigInteger def)非正常格式则返回 def static FloatparseFloat(@NonNull() String string)非正常格式则返回 null static floatparseFloat(@NonNull() String string, float def)非正常格式则返回 def static DoubleparseDouble(@NonNull() String string)非正常格式则返回 null static doubleparseDouble(@NonNull() String string, double def)非正常格式则返回 def static BigDecimalparseBigDecimal(@NonNull() String string)非正常格式则返回 null static BigDecimalparseBigDecimal(@NonNull() String string, @NonNull() BigDecimal def)非正常格式则返回 def -
-
Method Detail
-
isIntegerString
static boolean isIntegerString(@NonNull() String string)
判断一段文本是否为朴素的十进制整数文本
-
isDecimalString
static boolean isDecimalString(@NonNull() String string)
判断一段文本是否为朴素的十进制小数文本
-
parseShort
@Nullable() static Short parseShort(@NonNull() String string)
非正常格式则返回 null, 超限则返回对应侧最大值
-
parseShort
static short parseShort(@NonNull() String string, short def)
非正常格式则返回 def, 超限则返回对应侧最大值
-
parseInteger
@Nullable() static Integer parseInteger(@NonNull() String string)
非正常格式则返回 null, 超限则返回对应侧最大值
-
parseInteger
static int parseInteger(@NonNull() String string, int def)
非正常格式则返回 def, 超限则返回对应侧最大值
-
parseBigInteger
@Nullable() static BigInteger parseBigInteger(@NonNull() String string)
非正常格式则返回 null
-
parseBigInteger
@NonNull() static BigInteger parseBigInteger(@NonNull() String string, @NonNull() BigInteger def)
非正常格式则返回 def
-
parseFloat
@Nullable() static Float parseFloat(@NonNull() String string)
非正常格式则返回 null
-
parseFloat
static float parseFloat(@NonNull() String string, float def)
非正常格式则返回 def
-
parseDouble
@Nullable() static Double parseDouble(@NonNull() String string)
非正常格式则返回 null
-
parseDouble
static double parseDouble(@NonNull() String string, double def)
非正常格式则返回 def
-
parseBigDecimal
@Nullable() static BigDecimal parseBigDecimal(@NonNull() String string)
非正常格式则返回 null
-
parseBigDecimal
@NonNull() static BigDecimal parseBigDecimal(@NonNull() String string, @NonNull() BigDecimal def)
非正常格式则返回 def
-
-
-
-