Class NumberParser

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      NumberParser()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static boolean isIntegerString(@NonNull() String string) 判断一段文本是否为朴素的十进制整数文本
      static boolean isDecimalString(@NonNull() String string) 判断一段文本是否为朴素的十进制小数文本
      static Byte parseByte(@NonNull() String string) 非正常格式则返回 null, 超限则返回对应侧最大值
      static byte parseByte(@NonNull() String string, byte def) 非正常格式则返回 def, 超限则返回对应侧最大值
      static Short parseShort(@NonNull() String string) 非正常格式则返回 null, 超限则返回对应侧最大值
      static short parseShort(@NonNull() String string, short def) 非正常格式则返回 def, 超限则返回对应侧最大值
      static Integer parseInteger(@NonNull() String string) 非正常格式则返回 null, 超限则返回对应侧最大值
      static int parseInteger(@NonNull() String string, int def) 非正常格式则返回 def, 超限则返回对应侧最大值
      static Long parseLong(@NonNull() String string) 非正常格式则返回 null, 超限则返回对应侧最大值
      static long parseLong(@NonNull() String string, long def) 非正常格式则返回 def, 超限则返回对应侧最大值
      static BigInteger parseBigInteger(@NonNull() String string) 非正常格式则返回 null
      static BigInteger parseBigInteger(@NonNull() String string, @NonNull() BigInteger def) 非正常格式则返回 def
      static Float parseFloat(@NonNull() String string) 非正常格式则返回 null
      static float parseFloat(@NonNull() String string, float def) 非正常格式则返回 def
      static Double parseDouble(@NonNull() String string) 非正常格式则返回 null
      static double parseDouble(@NonNull() String string, double def) 非正常格式则返回 def
      static BigDecimal parseBigDecimal(@NonNull() String string) 非正常格式则返回 null
      static BigDecimal parseBigDecimal(@NonNull() String string, @NonNull() BigDecimal def) 非正常格式则返回 def
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NumberParser

        NumberParser()
    • Method Detail

      • isIntegerString

         static boolean isIntegerString(@NonNull() String string)

        判断一段文本是否为朴素的十进制整数文本

      • isDecimalString

         static boolean isDecimalString(@NonNull() String string)

        判断一段文本是否为朴素的十进制小数文本

      • parseByte

        @Nullable() static Byte parseByte(@NonNull() String string)

        非正常格式则返回 null, 超限则返回对应侧最大值

      • parseByte

         static byte parseByte(@NonNull() String string, byte def)

        非正常格式则返回 def, 超限则返回对应侧最大值

      • 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, 超限则返回对应侧最大值

      • parseLong

        @Nullable() static Long parseLong(@NonNull() String string)

        非正常格式则返回 null, 超限则返回对应侧最大值

      • parseLong

         static long parseLong(@NonNull() String string, long def)

        非正常格式则返回 def, 超限则返回对应侧最大值

      • parseFloat

        @Nullable() static Float parseFloat(@NonNull() String string)

        非正常格式则返回 null

      • parseFloat

         static float parseFloat(@NonNull() String string, float def)

        非正常格式则返回 def

      • parseDouble

         static double parseDouble(@NonNull() String string, double def)

        非正常格式则返回 def