Class IntegerUtils


  • public final class IntegerUtils
    extends java.lang.Object
    IntegerUtils
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int convert​(java.lang.String strToParse)
      Convert a given String into an integer.
      static int convert​(java.lang.String strToParse, int nDefault)
      Convert a given String into an integer.
      static boolean isDefault​(int nNumber)
      Check if the given number is equal to DEFAULT
      static boolean isNotNumeric​(java.lang.String strToCheck)
      Check if the given String is not numerical
      static boolean isNumeric​(java.lang.String strToCheck)
      Check if the given String is numeric
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • convert

        public static int convert​(java.lang.String strToParse)
        Convert a given String into an integer.
        If the String is blank or is not numerical, then it returns DEFAULT.
        Parameters:
        strToParse - the String to convert
        Returns:
        the numerical value of the String
      • convert

        public static int convert​(java.lang.String strToParse,
                                  int nDefault)
        Convert a given String into an integer.
        If the String is blank or is not numerical, then it returns nDefault
        Parameters:
        strToParse - the String to parse
        nDefault - the default value in case the conversion fails
        Returns:
        the numerical value of the String
      • isNumeric

        public static boolean isNumeric​(java.lang.String strToCheck)
        Check if the given String is numeric
        Parameters:
        strToCheck - the String to check
        Returns:
        true if it is numeric, false otherwise
      • isNotNumeric

        public static boolean isNotNumeric​(java.lang.String strToCheck)
        Check if the given String is not numerical
        Parameters:
        strToCheck - the String to check
        Returns:
        true if it is not numeric, false otherwise
      • isDefault

        public static boolean isDefault​(int nNumber)
        Check if the given number is equal to DEFAULT
        Parameters:
        nNumber - the number to check
        Returns:
        true if it is equal, false otherwise