Class StringParser


  • @Immutable
    public final class StringParser
    extends Object
    This class contains the methods to parse String objects to numeric values. Before v3.7.0 this was contained in class StringHelper.
    Author:
    Philip Helger
    • Field Detail

      • DEFAULT_RADIX

        public static final int DEFAULT_RADIX
        The default radix used to convert string values to numeric values
        See Also:
        Constant Field Values
    • Method Detail

      • parseBool

        public static boolean parseBool​(@Nullable
                                        Object aObject)
        Try to interpret the passed object as boolean. This works only if the passed object is either a String or a Boolean.
        Parameters:
        aObject - The object to be interpreted. May be null.
        Returns:
        false if the passed object cannot be interpreted as a boolean.
      • parseBool

        public static boolean parseBool​(@Nullable
                                        Object aObject,
                                        boolean bDefault)
        Try to interpret the passed object as boolean. This works only if the passed object is either a String or a Boolean.
        Parameters:
        aObject - The object to be interpreted. May be null.
        bDefault - The default value to be returned, if the object cannot be interpreted.
        Returns:
        The boolean representation or the default value if the passed object cannot be interpreted as a boolean.
      • parseBool

        public static boolean parseBool​(@Nullable
                                        String sStr)
        Parse the given String as boolean value. All values that are equal to "true" (ignoring case) will result in true return values. All other values result in false return values. This method is equal to Boolean.parseBoolean(String)
        Parameters:
        sStr - The string to be interpreted. May be null.
        Returns:
        true if the passed string matches "true" (ignoring case), false otherwise.
        See Also:
        Boolean.parseBoolean(String)
      • parseBool

        public static boolean parseBool​(@Nullable
                                        String sStr,
                                        boolean bDefault)
        Parse the given String as boolean value. All values that are equal to "true" (ignoring case) will result in true return values. All values that are equal to "false" (ignoring case) will result in false return values. All other values will return the default.
        Parameters:
        sStr - The string to be interpreted. May be null.
        bDefault - The default value to be returned if the passed string is neither "true" nor "false".
        Returns:
        true or false :)
      • parseBoolObj

        @Nullable
        public static Boolean parseBoolObj​(@Nullable
                                           Object aObject)
        Try to interpret the passed object as boolean. This works only if the passed object is either a String or a Boolean.
        Parameters:
        aObject - The object to be interpreted. May be null.
        Returns:
        null if the passed object cannot be interpreted as a boolean, any other Boolean otherwise.
      • parseBoolObj

        @Nullable
        public static Boolean parseBoolObj​(@Nullable
                                           Object aObject,
                                           @Nullable
                                           Boolean aDefault)
        Try to interpret the passed Object as Boolean.
        Parameters:
        aObject - The object to be interpreted. May be null.
        aDefault - The default value to be returned, if the passed object is null.
        Returns:
        The passed default value if the passed object is null, the matching Boolean otherwise.
      • parseBoolObj

        @Nonnull
        public static Boolean parseBoolObj​(@Nullable
                                           String sStr)
        Returns a Boolean with a value represented by the specified string. The Boolean returned represents a true value if the string argument is not null and is equal, ignoring case, to the string "true". This method is equal to Boolean.valueOf(String)
        Parameters:
        sStr - The string to be parsed. May be null.
        Returns:
        the Boolean value represented by the string. Never null.
      • parseBoolObjExact

        @Nullable
        public static Boolean parseBoolObjExact​(@Nullable
                                                String sStr)
        Returns a Boolean with a value represented by the specified string. The Boolean returned represents a true value if the string argument is not null and is equal, ignoring case, to the string "true", and it will return false if the string argument is not null and is equal, ignoring case, to the string "false". In all other cases null is returned.
        Parameters:
        sStr - The string to be parsed. May be null.
        Returns:
        the Boolean value represented by the string. Never null.
      • parseBoolObjExact

        @Nullable
        public static Boolean parseBoolObjExact​(@Nullable
                                                String sStr,
                                                @Nullable
                                                Boolean aDefault)
        Returns a Boolean with a value represented by the specified string. The Boolean returned represents a true value if the string argument is not null and is equal, ignoring case, to the string "true", and it will return false if the string argument is not null and is equal, ignoring case, to the string "false". In all other cases aDefault is returned.
        Parameters:
        sStr - The string to be parsed. May be null.
        aDefault - The default value to be returned if the value is neither "true" nor "false". May be null.
        Returns:
        the Boolean value represented by the string. Never null.
      • parseByte

        public static byte parseByte​(@Nullable
                                     Object aObject,
                                     byte nDefault)
        Parse the given Object as byte with radix 10.
        Parameters:
        aObject - The Object to parse. May be null.
        nDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default value if the string does not represent a valid value.
      • parseByte

        public static byte parseByte​(@Nullable
                                     Object aObject,
                                     @Nonnegative
                                     int nRadix,
                                     byte nDefault)
        Parse the given Object as byte with the specified radix.
        Parameters:
        aObject - The Object to parse. May be null.
        nRadix - The radix to use. Must be ≥ Character.MIN_RADIX and ≤ Character.MAX_RADIX.
        nDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default value if the string does not represent a valid value.
      • parseByte

        public static byte parseByte​(@Nullable
                                     String sStr,
                                     byte nDefault)
        Parse the given String as byte with radix 10.
        Parameters:
        sStr - The String to parse. May be null.
        nDefault - The value to be returned if the string cannot be converted to a valid value.
        Returns:
        The passed default parameter if the string does not represent a valid value.
      • parseByte

        public static byte parseByte​(@Nullable
                                     String sStr,
                                     @Nonnegative
                                     int nRadix,
                                     byte nDefault)
        Parse the given String as byte with the specified radix.
        Parameters:
        sStr - The String to parse. May be null.
        nRadix - The radix to use. Must be ≥ Character.MIN_RADIX and ≤ Character.MAX_RADIX.
        nDefault - The value to be returned if the string cannot be converted to a valid value.
        Returns:
        The passed default parameter if the string does not represent a valid value.
      • parseByteObj

        @Nullable
        public static Byte parseByteObj​(@Nullable
                                        Object aObject)
        Parse the given Object as Byte with radix 10.
        Parameters:
        aObject - The object to parse. May be null.
        Returns:
        null if the object does not represent a valid value.
      • parseByteObj

        @Nullable
        public static Byte parseByteObj​(@Nullable
                                        Object aObject,
                                        @Nullable
                                        Byte aDefault)
        Parse the given Object as Byte with radix 10.
        Parameters:
        aObject - The object to parse. May be null.
        aDefault - The default value to be returned, if the passed object cannot be converted. May be null.
        Returns:
        the passed default value if the object does not represent a valid value.
      • parseByteObj

        @Nullable
        public static Byte parseByteObj​(@Nullable
                                        Object aObject,
                                        @Nonnegative
                                        int nRadix,
                                        @Nullable
                                        Byte aDefault)
        Parse the given Object as Byte with the specified radix.
        Parameters:
        aObject - The object to parse. May be null.
        nRadix - The radix to use. Must be ≥ Character.MIN_RADIX and ≤ Character.MAX_RADIX.
        aDefault - The default value to be returned, if the passed object cannot be converted. May be null.
        Returns:
        the passed default value if the object does not represent a valid value.
      • parseByteObj

        @Nullable
        public static Byte parseByteObj​(@Nullable
                                        String sStr)
        Parse the given String as Byte with radix 10.
        Parameters:
        sStr - The String to parse. May be null.
        Returns:
        null if the string does not represent a valid value.
      • parseByteObj

        @Nullable
        public static Byte parseByteObj​(@Nullable
                                        String sStr,
                                        @Nullable
                                        Byte aDefault)
        Parse the given String as Byte with radix 10.
        Parameters:
        sStr - The String to parse. May be null.
        aDefault - The default value to be returned if the passed string could not be converted to a valid value. May be null.
        Returns:
        aDefault if the string does not represent a valid value.
      • parseByteObj

        @Nullable
        public static Byte parseByteObj​(@Nullable
                                        String sStr,
                                        @Nonnegative
                                        int nRadix,
                                        @Nullable
                                        Byte aDefault)
        Parse the given String as Byte with the specified radix.
        Parameters:
        sStr - The String to parse. May be null.
        nRadix - The radix to use. Must be ≥ Character.MIN_RADIX and ≤ Character.MAX_RADIX.
        aDefault - The default value to be returned if the passed string could not be converted to a valid value. May be null.
        Returns:
        aDefault if the string does not represent a valid value.
      • parseDouble

        public static double parseDouble​(@Nullable
                                         Object aObject,
                                         double dDefault)
        Parse the given Object as double. Note: both the locale independent form of a double can be parsed here (e.g. 4.523) as well as a localized form using the comma as the decimal separator (e.g. the German 4,523).
        Parameters:
        aObject - The object to parse. May be null.
        dDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default value if the object does not represent a valid value.
      • parseDouble

        public static double parseDouble​(@Nullable
                                         String sStr,
                                         double dDefault)
        Parse the given String as double.
        Parameters:
        sStr - The string to parse. May be null.
        dDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default value if the string does not represent a valid value.
      • parseDoubleObj

        @Nullable
        public static Double parseDoubleObj​(@Nullable
                                            Object aObject)
        Parse the given Object as Double. Note: both the locale independent form of a double can be parsed here (e.g. 4.523) as well as a localized form using the comma as the decimal separator (e.g. the German 4,523).
        Parameters:
        aObject - The object to parse. May be null.
        Returns:
        null if the object does not represent a valid value.
      • parseDoubleObj

        @Nullable
        public static Double parseDoubleObj​(@Nullable
                                            Object aObject,
                                            @Nullable
                                            Double aDefault)
        Parse the given Object as Double. Note: both the locale independent form of a double can be parsed here (e.g. 4.523) as well as a localized form using the comma as the decimal separator (e.g. the German 4,523).
        Parameters:
        aObject - The object to parse. May be null.
        aDefault - The default value to be returned if the parsed object cannot be converted to a double. May be null.
        Returns:
        aDefault if the object does not represent a valid value.
      • parseDoubleObj

        @Nullable
        public static Double parseDoubleObj​(@Nullable
                                            String sStr)
        Parse the given String as Double. Note: both the locale independent form of a double can be parsed here (e.g. 4.523) as well as a localized form using the comma as the decimal separator (e.g. the German 4,523).
        Parameters:
        sStr - The string to parse. May be null.
        Returns:
        null if the object does not represent a valid value.
      • parseDoubleObj

        @Nullable
        public static Double parseDoubleObj​(@Nullable
                                            String sStr,
                                            @Nullable
                                            Double aDefault)
        Parse the given String as Double. Note: both the locale independent form of a double can be parsed here (e.g. 4.523) as well as a localized form using the comma as the decimal separator (e.g. the German 4,523).
        Parameters:
        sStr - The string to parse. May be null.
        aDefault - The default value to be returned if the parsed string cannot be converted to a double. May be null.
        Returns:
        aDefault if the object does not represent a valid value.
      • parseFloat

        public static float parseFloat​(@Nullable
                                       Object aObject,
                                       float fDefault)
        Parse the given Object as float. Note: both the locale independent form of a float can be parsed here (e.g. 4.523) as well as a localized form using the comma as the decimal separator (e.g. the German 4,523).
        Parameters:
        aObject - The object to parse. May be null.
        fDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default value if the object does not represent a valid value.
      • parseFloat

        public static float parseFloat​(@Nullable
                                       String sStr,
                                       float fDefault)
        Parse the given String as float.
        Parameters:
        sStr - The string to parse. May be null.
        fDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default value if the string does not represent a valid value.
      • parseFloatObj

        @Nullable
        public static Float parseFloatObj​(@Nullable
                                          Object aObject)
        Parse the given Object as Float. Note: both the locale independent form of a double can be parsed here (e.g. 4.523) as well as a localized form using the comma as the decimal separator (e.g. the German 4,523).
        Parameters:
        aObject - The object to parse. May be null.
        Returns:
        null if the object does not represent a valid value.
      • parseFloatObj

        @Nullable
        public static Float parseFloatObj​(@Nullable
                                          Object aObject,
                                          @Nullable
                                          Float aDefault)
        Parse the given Object as Float. Note: both the locale independent form of a double can be parsed here (e.g. 4.523) as well as a localized form using the comma as the decimal separator (e.g. the German 4,523).
        Parameters:
        aObject - The object to parse. May be null.
        aDefault - The default value to be returned if the parsed object cannot be converted to a float. May be null.
        Returns:
        aDefault if the object does not represent a valid value.
      • parseFloatObj

        @Nullable
        public static Float parseFloatObj​(@Nullable
                                          String sStr)
        Parse the given String as Float. Note: both the locale independent form of a double can be parsed here (e.g. 4.523) as well as a localized form using the comma as the decimal separator (e.g. the German 4,523).
        Parameters:
        sStr - The string to parse. May be null.
        Returns:
        null if the object does not represent a valid value.
      • parseFloatObj

        @Nullable
        public static Float parseFloatObj​(@Nullable
                                          String sStr,
                                          @Nullable
                                          Float aDefault)
        Parse the given String as Float. Note: both the locale independent form of a double can be parsed here (e.g. 4.523) as well as a localized form using the comma as the decimal separator (e.g. the German 4,523).
        Parameters:
        sStr - The string to parse. May be null.
        aDefault - The default value to be returned if the parsed string cannot be converted to a float. May be null.
        Returns:
        aDefault if the object does not represent a valid value.
      • parseInt

        public static int parseInt​(@Nullable
                                   Object aObject,
                                   int nDefault)
        Parse the given Object as int with radix DEFAULT_RADIX.
        Parameters:
        aObject - The Object to parse. May be null.
        nDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default value if the string does not represent a valid value.
      • parseInt

        public static int parseInt​(@Nullable
                                   Object aObject,
                                   @Nonnegative
                                   int nRadix,
                                   int nDefault)
        Parse the given Object as int with the specified radix.
        Parameters:
        aObject - The object to parse. May be null.
        nRadix - The radix to use. Must be ≥ Character.MIN_RADIX and ≤ Character.MAX_RADIX.
        nDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default value if the string does not represent a valid value.
      • parseInt

        public static int parseInt​(@Nullable
                                   String sStr,
                                   int nDefault)
        Parse the given String as int with radix 10.
        Parameters:
        sStr - The String to parse. May be null.
        nDefault - The value to be returned if the string cannot be converted to a valid value.
        Returns:
        The passed default parameter if the string does not represent a valid value.
      • parseInt

        public static int parseInt​(@Nullable
                                   String sStr,
                                   @Nonnegative
                                   int nRadix,
                                   int nDefault)
        Parse the given String as int with the specified radix.
        Parameters:
        sStr - The String to parse. May be null.
        nRadix - The radix to use. Must be ≥ Character.MIN_RADIX and ≤ Character.MAX_RADIX.
        nDefault - The value to be returned if the string cannot be converted to a valid value.
        Returns:
        The passed default parameter if the string does not represent a valid value.
      • parseIntObj

        @Nullable
        public static Integer parseIntObj​(@Nullable
                                          Object aObject)
        Parse the given Object as Integer with radix 10.
        Parameters:
        aObject - The object to parse. May be null.
        Returns:
        null if the object does not represent a valid value.
      • parseIntObj

        @Nullable
        public static Integer parseIntObj​(@Nullable
                                          Object aObject,
                                          @Nullable
                                          Integer aDefault)
        Parse the given Object as Integer with radix 10.
        Parameters:
        aObject - The object to parse. May be null.
        aDefault - The default value to be returned if the passed object cannot be converted to an Integer. May be null.
        Returns:
        aDefault if the object does not represent a valid value.
      • parseIntObj

        @Nullable
        public static Integer parseIntObj​(@Nullable
                                          String sStr)
        Parse the given String as Integer with radix 10.
        Parameters:
        sStr - The string to parse. May be null.
        Returns:
        null if the string does not represent a valid value.
      • parseIntObj

        @Nullable
        public static Integer parseIntObj​(@Nullable
                                          String sStr,
                                          @Nullable
                                          Integer aDefault)
        Parse the given String as Integer with radix DEFAULT_RADIX.
        Parameters:
        sStr - The string to parse. May be null.
        aDefault - The default value to be returned if the passed string could not be converted to a valid value. May be null.
        Returns:
        aDefault if the string does not represent a valid value.
      • parseUnsignedIntObj

        @Nullable
        public static Long parseUnsignedIntObj​(@Nullable
                                               String sStr)
        Parse the given String as unsigned Integer with radix 10.
        Parameters:
        sStr - The string to parse. May be null.
        Returns:
        null if the string does not represent a valid value.
        Since:
        9.0.0
      • parseUnsignedIntObj

        @Nullable
        public static Long parseUnsignedIntObj​(@Nullable
                                               String sStr,
                                               @Nullable
                                               Long aDefault)
        Parse the given String as unsigned Integer with radix DEFAULT_RADIX.
        Parameters:
        sStr - The string to parse. May be null.
        aDefault - The default value to be returned if the passed string could not be converted to a valid value. May be null.
        Returns:
        aDefault if the string does not represent a valid value.
        Since:
        9.0.0
      • parseUnsignedIntObj

        @Nullable
        public static Long parseUnsignedIntObj​(@Nullable
                                               String sStr,
                                               @Nonnegative
                                               int nRadix,
                                               @Nullable
                                               Long aDefault)
        Parse the given String as unsigned Integer with the specified radix.
        Parameters:
        sStr - The string to parse. May be null.
        nRadix - The radix to use. Must be ≥ Character.MIN_RADIX and ≤ Character.MAX_RADIX.
        aDefault - The default value to be returned if the passed string could not be converted to a valid value. May be null.
        Returns:
        aDefault if the string does not represent a valid value.
        Since:
        9.0.0
      • parseLong

        public static long parseLong​(@Nullable
                                     Object aObject,
                                     long nDefault)
        Parse the given Object as long with radix 10.
        Parameters:
        aObject - The object to parse. May be null.
        nDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default value if the object does not represent a valid value.
      • parseLong

        public static long parseLong​(@Nullable
                                     Object aObject,
                                     @Nonnegative
                                     int nRadix,
                                     long nDefault)
        Parse the given Object as long with the specified radix.
        Parameters:
        aObject - The object to parse. May be null.
        nRadix - The radix to use. Must be ≥ Character.MIN_RADIX and ≤ Character.MAX_RADIX.
        nDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default value if the object does not represent a valid value.
      • parseLong

        public static long parseLong​(@Nullable
                                     String sStr,
                                     long nDefault)
        Parse the given String as long with radix 10.
        Parameters:
        sStr - The string to parse. May be null.
        nDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default if the string does not represent a valid value.
      • parseLong

        public static long parseLong​(@Nullable
                                     String sStr,
                                     @Nonnegative
                                     int nRadix,
                                     long nDefault)
        Parse the given String as long with the specified radix.
        Parameters:
        sStr - The string to parse. May be null.
        nRadix - The radix to use. Must be ≥ Character.MIN_RADIX and ≤ Character.MAX_RADIX.
        nDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default if the string does not represent a valid value.
      • parseLongObj

        @Nullable
        public static Long parseLongObj​(@Nullable
                                        Object aObject)
        Parse the given Object as Long with radix 10.
        Parameters:
        aObject - The object to parse. May be null.
        Returns:
        null if the object does not represent a valid value.
      • parseLongObj

        @Nullable
        public static Long parseLongObj​(@Nullable
                                        Object aObject,
                                        @Nullable
                                        Long aDefault)
        Parse the given Object as Long with radix 10.
        Parameters:
        aObject - The object to parse. May be null.
        aDefault - The default value to be returned if the passed object cannot be converted to a Long. May be null.
        Returns:
        aDefault if the object does not represent a valid value.
      • parseLongObj

        @Nullable
        public static Long parseLongObj​(@Nullable
                                        Object aObject,
                                        @Nonnegative
                                        int nRadix,
                                        @Nullable
                                        Long aDefault)
        Parse the given Object as Long with the specified radix.
        Parameters:
        aObject - The object to parse. May be null.
        nRadix - The radix to use. Must be ≥ Character.MIN_RADIX and ≤ Character.MAX_RADIX.
        aDefault - The default value to be returned if the passed object cannot be converted to a Long. May be null.
        Returns:
        aDefault if the object does not represent a valid value.
      • parseLongObj

        @Nullable
        public static Long parseLongObj​(@Nullable
                                        String sStr)
        Parse the given String as Long with radix 10.
        Parameters:
        sStr - The string to parse. May be null.
        Returns:
        null if the string does not represent a valid value.
      • parseLongObj

        @Nullable
        public static Long parseLongObj​(@Nullable
                                        String sStr,
                                        @Nullable
                                        Long aDefault)
        Parse the given String as Long with radix DEFAULT_RADIX.
        Parameters:
        sStr - The string to parse. May be null.
        aDefault - The default value to be returned if the passed string could not be converted to a valid value. May be null.
        Returns:
        aDefault if the string does not represent a valid value.
      • parseLongObj

        @Nullable
        public static Long parseLongObj​(@Nullable
                                        String sStr,
                                        @Nonnegative
                                        int nRadix,
                                        @Nullable
                                        Long aDefault)
        Parse the given String as Long with the specified radix.
        Parameters:
        sStr - The string to parse. May be null.
        nRadix - The radix to use. Must be ≥ Character.MIN_RADIX and ≤ Character.MAX_RADIX.
        aDefault - The default value to be returned if the passed string could not be converted to a valid value. May be null.
        Returns:
        aDefault if the string does not represent a valid value.
      • parseShort

        public static short parseShort​(@Nullable
                                       Object aObject,
                                       short nDefault)
        Parse the given Object as short with radix 10.
        Parameters:
        aObject - The object to parse. May be null.
        nDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default value if the object does not represent a valid value.
      • parseShort

        public static short parseShort​(@Nullable
                                       Object aObject,
                                       @Nonnegative
                                       int nRadix,
                                       short nDefault)
        Parse the given Object as short with the specified radix.
        Parameters:
        aObject - The object to parse. May be null.
        nRadix - The radix to use. Must be ≥ Character.MIN_RADIX and ≤ Character.MAX_RADIX.
        nDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default value if the object does not represent a valid value.
      • parseShort

        public static short parseShort​(@Nullable
                                       String sStr,
                                       short nDefault)
        Parse the given String as short with radix 10.
        Parameters:
        sStr - The string to parse. May be null.
        nDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default if the string does not represent a valid value.
      • parseShort

        public static short parseShort​(@Nullable
                                       String sStr,
                                       @Nonnegative
                                       int nRadix,
                                       short nDefault)
        Parse the given String as short with the specified radix.
        Parameters:
        sStr - The string to parse. May be null.
        nRadix - The radix to use. Must be ≥ Character.MIN_RADIX and ≤ Character.MAX_RADIX.
        nDefault - The default value to be returned if the passed object could not be converted to a valid value.
        Returns:
        The default if the string does not represent a valid value.
      • parseShortObj

        @Nullable
        public static Short parseShortObj​(@Nullable
                                          Object aObject)
        Parse the given Object as Short with radix 10.
        Parameters:
        aObject - The object to parse. May be null.
        Returns:
        null if the object does not represent a valid value.
      • parseShortObj

        @Nullable
        public static Short parseShortObj​(@Nullable
                                          Object aObject,
                                          @Nullable
                                          Short aDefault)
        Parse the given Object as Short with radix 10.
        Parameters:
        aObject - The object to parse. May be null.
        aDefault - The default value to be returned if the passed object cannot be converted to a Short. May be null.
        Returns:
        aDefault if the object does not represent a valid value.
      • parseShortObj

        @Nullable
        public static Short parseShortObj​(@Nullable
                                          Object aObject,
                                          @Nonnegative
                                          int nRadix,
                                          @Nullable
                                          Short aDefault)
        Parse the given Object as Short with the specified radix.
        Parameters:
        aObject - The object to parse. May be null.
        nRadix - The radix to use. Must be ≥ Character.MIN_RADIX and ≤ Character.MAX_RADIX.
        aDefault - The default value to be returned if the passed object cannot be converted to a Short. May be null.
        Returns:
        aDefault if the object does not represent a valid value.
      • parseShortObj

        @Nullable
        public static Short parseShortObj​(@Nullable
                                          String sStr)
        Parse the given String as Short with radix 10.
        Parameters:
        sStr - The string to parse. May be null.
        Returns:
        null if the string does not represent a valid value.
      • parseShortObj

        @Nullable
        public static Short parseShortObj​(@Nullable
                                          String sStr,
                                          @Nullable
                                          Short aDefault)
        Parse the given String as Short with radix DEFAULT_RADIX.
        Parameters:
        sStr - The string to parse. May be null.
        aDefault - The default value to be returned if the passed string could not be converted to a valid value. May be null.
        Returns:
        aDefault if the string does not represent a valid value.
      • parseShortObj

        @Nullable
        public static Short parseShortObj​(@Nullable
                                          String sStr,
                                          @Nonnegative
                                          int nRadix,
                                          @Nullable
                                          Short aDefault)
        Parse the given String as Short with the specified radix.
        Parameters:
        sStr - The string to parse. May be null.
        nRadix - The radix to use. Must be ≥ Character.MIN_RADIX and ≤ Character.MAX_RADIX.
        aDefault - The default value to be returned if the passed string could not be converted to a valid value. May be null.
        Returns:
        aDefault if the string does not represent a valid value.
      • parseBigInteger

        @Nullable
        public static BigInteger parseBigInteger​(@Nullable
                                                 String sStr)
        Parse the given String as BigInteger with radix 10.
        Parameters:
        sStr - The String to parse. May be null.
        Returns:
        null if the string does not represent a valid value.
      • parseBigInteger

        @Nullable
        public static BigInteger parseBigInteger​(@Nullable
                                                 String sStr,
                                                 @Nullable
                                                 BigInteger aDefault)
        Parse the given String as BigInteger with radix 10.
        Parameters:
        sStr - The String to parse. May be null.
        aDefault - The default value to be returned if the passed string could not be converted to a valid value. May be null.
        Returns:
        aDefault if the string does not represent a valid value.
      • parseBigDecimal

        @Nullable
        public static BigDecimal parseBigDecimal​(@Nullable
                                                 String sStr)
        Parse the given String as BigDecimal.
        Parameters:
        sStr - The String to parse. May be null.
        Returns:
        null if the string does not represent a valid value.
      • parseBigDecimal

        @Nullable
        public static BigDecimal parseBigDecimal​(@Nullable
                                                 String sStr,
                                                 @Nullable
                                                 BigDecimal aDefault)
        Parse the given String as BigDecimal.
        Parameters:
        sStr - The String to parse. May be null.
        aDefault - The default value to be returned if the passed string could not be converted to a valid value. May be null.
        Returns:
        aDefault if the string does not represent a valid value.
      • parseBigDecimal

        @Nullable
        public static BigDecimal parseBigDecimal​(@Nullable
                                                 String sStr,
                                                 @Nonnegative
                                                 int nScale,
                                                 @Nonnull
                                                 RoundingMode eRoundingMode)
        Parse the given String as BigDecimal.
        Parameters:
        sStr - The String to parse. May be null.
        nScale - The scaling (decimal places) to be used for the result. Must be ≥ 0!
        eRoundingMode - The rounding mode to be used to achieve the scale. May not be null.
        Returns:
        null if the string does not represent a valid value.
      • parseBigDecimal

        @Nullable
        public static BigDecimal parseBigDecimal​(@Nullable
                                                 String sStr,
                                                 @Nonnegative
                                                 int nScale,
                                                 @Nonnull
                                                 RoundingMode eRoundingMode,
                                                 @Nullable
                                                 BigDecimal aDefault)
        Parse the given String as BigDecimal.
        Parameters:
        sStr - The String to parse. May be null.
        nScale - The scaling (decimal places) to be used for the result. Must be ≥ 0!
        eRoundingMode - The rounding mode to be used to achieve the scale. May not be null.
        aDefault - The default value to be returned if the passed string could not be converted to a valid value. May be null.
        Returns:
        aDefault if the string does not represent a valid value.
      • isInt

        public static boolean isInt​(@Nullable
                                    String sStr)
        Checks if the given string is a numeric string that can be converted to a long value with radix 10.
        Parameters:
        sStr - The string to check. May be null.
        Returns:
        true if the value can be converted to a valid value
      • isLong

        public static boolean isLong​(@Nullable
                                     String sStr)
        Checks if the given string is a numeric string that can be converted to a long value with radix 10.
        Parameters:
        sStr - The string to check. May be null.
        Returns:
        true if the value can be converted to a valid value
      • isUnsignedInt

        public static boolean isUnsignedInt​(@Nullable
                                            String sStr)
        Checks if the given string is a numeric string that can be converted to an unsigned long value with radix 10.
        Parameters:
        sStr - The string to check. May be null.
        Returns:
        true if the value can be converted to a valid value
      • isUnsignedLong

        public static boolean isUnsignedLong​(@Nullable
                                             String sStr)
        Checks if the given string is a numeric string that can be converted to an unsigned long value with radix 10.
        Parameters:
        sStr - The string to check. May be null.
        Returns:
        true if the value can be converted to a valid value
      • isDouble

        public static boolean isDouble​(@Nullable
                                       String sStr)
        Checks if the given string is a double string that can be converted to a double value.
        Parameters:
        sStr - The string to check. May be null.
        Returns:
        true if the value can be converted to a valid value
      • isFloat

        public static boolean isFloat​(@Nullable
                                      String sStr)
        Checks if the given string is a float string that can be converted to a double value.
        Parameters:
        sStr - The string to check. May be null.
        Returns:
        true if the value can be converted to a valid value