mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/utils/ArgumentValidatorUtil.java
public static Object convertToActualType(final String value, final Class<?> type) //NOCHECKSTYLE: High cyclomatic 
    { //complexity. Need to handle all base types. 
        if (type == Double.class || type == double.class)
        {
            return Double.parseDouble(value);
        }
        else if (type == Float.class || type == float.class)
        {
            return Float.parseFloat(value);
        }
        else if (type == Integer.class || type == int.class)
        {
            return Integer.parseInt(value);
        }
        else if (type == Long.class || type == long.class)
        {
            return Long.parseLong(value);
        }
        else if (type == Short.class || type == short.class)
        {
            return Short.parseShort(value);
        }
        else if (type == Byte.class || type == byte.class)
        {
            return Byte.parseByte(value);
        }
        else if (type == Boolean.class || type == boolean.class)
        {
            if (value.equalsIgnoreCase(Boolean.TRUE.toString()))
            {
                return true;
            }
            else if (value.equalsIgnoreCase(Boolean.FALSE.toString()))
            {
                return false;
            }
            else
            {
                throw new IllegalArgumentException(String.format("Value: %s cannot be parsed to a boolean value.", 
                        value));
            }
        }
        else if (type == Character.class || type == char.class)
        {
            return value.charAt(0);
        }
        else
        {
            return value;
        }
    }
/**
     * Method that converts a string to its actual value type. Used to convert values being returned from an XHTML page
     * since that all values being returned are of the String type regardless of what the actual value is.
     * 
     * @param value
     *          Value to be converted from a string to its actual type.
     * @param type
     *          Class type the string value is to be converted to.
     * @return
     *          Object that represents the converted value.
     */
Method that converts a string to its actual value type. Used to convert values being returned from an XHTML page
since that all values being returned are of the String type regardless of what the actual value is.

@param value
Value to be converted from a string to its actual type.
@param type
Class type the string value is to be converted to.
@return
Object that represents the converted value.
Method that converts a string to its actual value type . Used to convert values being returned from an XHTML page since that all values being returned are of the String type regardless of what the actual value is . @param value Value to be converted from a string to its actual type . @param type Class type the string value is to be converted to . @return Object that represents the converted value .
public static Object convertToActualType(final String value, final Class<?> type) 
    { 
        if (type == Double.class || type == double.class)
        {
            return Double.parseDouble(value);
        }
        else if (type == Float.class || type == float.class)
        {
            return Float.parseFloat(value);
        }
        else if (type == Integer.class || type == int.class)
        {
            return Integer.parseInt(value);
        }
        else if (type == Long.class || type == long.class)
        {
            return Long.parseLong(value);
        }
        else if (type == Short.class || type == short.class)
        {
            return Short.parseShort(value);
        }
        else if (type == Byte.class || type == byte.class)
        {
            return Byte.parseByte(value);
        }
        else if (type == Boolean.class || type == boolean.class)
        {
            if (value.equalsIgnoreCase(Boolean.TRUE.toString()))
            {
                return true;
            }
            else if (value.equalsIgnoreCase(Boolean.FALSE.toString()))
            {
                return false;
            }
            else
            {
                throw new IllegalArgumentException(String.format("Value: %s cannot be parsed to a boolean value.", 
                        value));
            }
        }
        else if (type == Character.class || type == char.class)
        {
            return value.charAt(0);
        }
        else
        {
            return value;
        }
    }
public static Object convertToActualType ( final String value , final Class < ? > type ) { if ( type == Double . class || type == double . class ) { return Double . parseDouble ( value ) ; } else if ( type == Float . class || type == float . class ) { return Float . parseFloat ( value ) ; } else if ( type == Integer . class || type == int . class ) { return Integer . parseInt ( value ) ; } else if ( type == Long . class || type == long . class ) { return Long . parseLong ( value ) ; } else if ( type == Short . class || type == short . class ) { return Short . parseShort ( value ) ; } else if ( type == Byte . class || type == byte . class ) { return Byte . parseByte ( value ) ; } else if ( type == Boolean . class || type == boolean . class ) { if ( value . equalsIgnoreCase ( Boolean . TRUE . toString ( ) ) ) { return true ; } else if ( value . equalsIgnoreCase ( Boolean . FALSE . toString ( ) ) ) { return false ; } else { throw new IllegalArgumentException ( String . format ( "Value: %s cannot be parsed to a boolean value." , value ) ) ; } } else if ( type == Character . class || type == char . class ) { return value . charAt ( 0 ) ; } else { return value ; } }
Method that converts a string to its actual value type.
Method that converts a string to its actual value type .
//NOCHECKSTYLE: High cyclomatic  //complexity. Need to handle all base types. 