fr.paris.lutece.plugins.document.utils
Class IntegerUtils

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

public final class IntegerUtils
extends java.lang.Object

IntegerUtils


Method Summary
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

convert

public static final 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 final 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 final 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 final 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 final 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


Copyright © 2012 Mairie de Paris. All Rights Reserved.