Class IntegerUtils
java.lang.Object
fr.paris.lutece.plugins.document.utils.IntegerUtils
IntegerUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic intConvert a given String into an integer.static intConvert 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 booleanCheck if the given String is numeric
-
Method Details
-
convert
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
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
Check if the given String is numeric- Parameters:
strToCheck- the String to check- Returns:
- true if it is numeric, false otherwise
-
isNotNumeric
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
-