Class IntegerUtils
- java.lang.Object
-
- fr.paris.lutece.plugins.document.utils.IntegerUtils
-
public final class IntegerUtils extends Object
IntegerUtils
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intconvert(String strToParse)Convert a given String into an integer.static intconvert(String strToParse, int nDefault)Convert a given String into an integer.static booleanisDefault(int nNumber)Check if the given number is equal toDEFAULTstatic booleanisNotNumeric(String strToCheck)Check if the given String is not numericalstatic booleanisNumeric(String strToCheck)Check if the given String is numeric
-
-
-
Method Detail
-
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 returnsDEFAULT.- 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 parsenDefault- 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 toDEFAULT- Parameters:
nNumber- the number to check- Returns:
- true if it is equal, false otherwise
-
-