mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/utils/ArgumentValidatorUtil.java
public static ValidationEnum isValidValue(final String value, final String minValue, //NOCHECKSTYLE:
        final String maxValue, final Class<?> classType) //high cyclomatic complexity, need to handle all simple types
    {
        try
        {
            if (classType == Integer.class || classType == int.class)
            {
                final Integer parsedValue = Integer.parseInt(value);
                return checkInteger(parsedValue, minValue, maxValue);
            }
            else if (classType == Double.class || classType == double.class)
            {
                final Double parsedValue = Double.parseDouble(value);
                return checkDouble(parsedValue, minValue, maxValue);
            }
            else if (classType == Float.class || classType == float.class)
            {
                final Float parsedValue = Float.parseFloat(value);
                return checkFloat(parsedValue, minValue, maxValue);
            }
            else if (classType == Long.class || classType == long.class)
            {
                final Long parsedValue = Long.parseLong(value);
                return checkLong(parsedValue, minValue, maxValue);
            }
            else if (classType == Short.class || classType == short.class)
            {
                final Short parsedValue = Short.parseShort(value);
                return checkShort(parsedValue, minValue, maxValue);
            }
            else if (classType == Byte.class || classType == byte.class)
            {
                final Byte parsedValue = Byte.parseByte(value);
                return checkByte(parsedValue, minValue, maxValue);
            }
            else if (classType == Boolean.class || classType == boolean.class)
            {
                if (value.equalsIgnoreCase(Boolean.TRUE.toString()))
                {
                    return ValidationEnum.PASSED;
                }
                else if (value.equalsIgnoreCase(Boolean.FALSE.toString()))
                {
                    return ValidationEnum.PASSED;
                }
                return ValidationEnum.PARSING_FAILURE;
            }
            else 
            {
                return ValidationEnum.PASSED;
            }
        }
        catch (final NumberFormatException exception)
        {
            return ValidationEnum.PARSING_FAILURE;
        }
    }
/**
     * Method that returns a boolean value of whether the value passed to the method is a valid value.
     * 
     * @param value
     *          The string representation of the value to be checked.
     * @param minValue
     *          String representation of the minimum value that can be set for the value being checked.
     * @param maxValue
     *          String representation of the maximum value that can be set for the value being checked.
     * @param classType
     *          Class type of the value being validated.
     * @return
     *          Enumeration which represents whether or not the value is valid and for what reason if it is not a valid
     *          value.
     */
Method that returns a boolean value of whether the value passed to the method is a valid value.

@param value
The string representation of the value to be checked.
@param minValue
String representation of the minimum value that can be set for the value being checked.
@param maxValue
String representation of the maximum value that can be set for the value being checked.
@param classType
Class type of the value being validated.
@return
Enumeration which represents whether or not the value is valid and for what reason if it is not a valid
value.
Method that returns a boolean value of whether the value passed to the method is a valid value . @param value The string representation of the value to be checked . @param minValue String representation of the minimum value that can be set for the value being checked . @param maxValue String representation of the maximum value that can be set for the value being checked . @param classType Class type of the value being validated . @return Enumeration which represents whether or not the value is valid and for what reason if it is not a valid value .
public static ValidationEnum isValidValue(final String value, final String minValue, 
        final String maxValue, final Class<?> classType) 
    {
        try
        {
            if (classType == Integer.class || classType == int.class)
            {
                final Integer parsedValue = Integer.parseInt(value);
                return checkInteger(parsedValue, minValue, maxValue);
            }
            else if (classType == Double.class || classType == double.class)
            {
                final Double parsedValue = Double.parseDouble(value);
                return checkDouble(parsedValue, minValue, maxValue);
            }
            else if (classType == Float.class || classType == float.class)
            {
                final Float parsedValue = Float.parseFloat(value);
                return checkFloat(parsedValue, minValue, maxValue);
            }
            else if (classType == Long.class || classType == long.class)
            {
                final Long parsedValue = Long.parseLong(value);
                return checkLong(parsedValue, minValue, maxValue);
            }
            else if (classType == Short.class || classType == short.class)
            {
                final Short parsedValue = Short.parseShort(value);
                return checkShort(parsedValue, minValue, maxValue);
            }
            else if (classType == Byte.class || classType == byte.class)
            {
                final Byte parsedValue = Byte.parseByte(value);
                return checkByte(parsedValue, minValue, maxValue);
            }
            else if (classType == Boolean.class || classType == boolean.class)
            {
                if (value.equalsIgnoreCase(Boolean.TRUE.toString()))
                {
                    return ValidationEnum.PASSED;
                }
                else if (value.equalsIgnoreCase(Boolean.FALSE.toString()))
                {
                    return ValidationEnum.PASSED;
                }
                return ValidationEnum.PARSING_FAILURE;
            }
            else 
            {
                return ValidationEnum.PASSED;
            }
        }
        catch (final NumberFormatException exception)
        {
            return ValidationEnum.PARSING_FAILURE;
        }
    }
public static ValidationEnum isValidValue ( final String value , final String minValue , final String maxValue , final Class < ? > classType ) { try { if ( classType == Integer . class || classType == int . class ) { final Integer parsedValue = Integer . parseInt ( value ) ; return checkInteger ( parsedValue , minValue , maxValue ) ; } else if ( classType == Double . class || classType == double . class ) { final Double parsedValue = Double . parseDouble ( value ) ; return checkDouble ( parsedValue , minValue , maxValue ) ; } else if ( classType == Float . class || classType == float . class ) { final Float parsedValue = Float . parseFloat ( value ) ; return checkFloat ( parsedValue , minValue , maxValue ) ; } else if ( classType == Long . class || classType == long . class ) { final Long parsedValue = Long . parseLong ( value ) ; return checkLong ( parsedValue , minValue , maxValue ) ; } else if ( classType == Short . class || classType == short . class ) { final Short parsedValue = Short . parseShort ( value ) ; return checkShort ( parsedValue , minValue , maxValue ) ; } else if ( classType == Byte . class || classType == byte . class ) { final Byte parsedValue = Byte . parseByte ( value ) ; return checkByte ( parsedValue , minValue , maxValue ) ; } else if ( classType == Boolean . class || classType == boolean . class ) { if ( value . equalsIgnoreCase ( Boolean . TRUE . toString ( ) ) ) { return ValidationEnum . PASSED ; } else if ( value . equalsIgnoreCase ( Boolean . FALSE . toString ( ) ) ) { return ValidationEnum . PASSED ; } return ValidationEnum . PARSING_FAILURE ; } else { return ValidationEnum . PASSED ; } } catch ( final NumberFormatException exception ) { return ValidationEnum . PARSING_FAILURE ; } }
Method that returns a boolean value of whether the value passed to the method is a valid value.
Method that returns a boolean value of whether the value passed to the method is a valid value .
//NOCHECKSTYLE: //high cyclomatic complexity, need to handle all simple types