Class IntegerUtils

java.lang.Object
fr.paris.lutece.plugins.document.utils.IntegerUtils

public final class IntegerUtils extends Object
IntegerUtils
  • Method Details

    • convert

      public static int convert(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(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(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(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