mil.dod.th.ose.utils/src/mil/dod/th/ose/utils/ConfigurationUtils.java
public static Object parseStringByType(final int type, final String value)
    {
        switch (type)
        {
            case AttributeDefinition.BOOLEAN:
                return Boolean.parseBoolean(value);

            case AttributeDefinition.BYTE:
                return Byte.parseByte(value);

            case AttributeDefinition.CHARACTER:
                return value.charAt(0);

            case AttributeDefinition.DOUBLE:
                return Double.parseDouble(value);

            case AttributeDefinition.FLOAT:
                return Float.parseFloat(value);

            case AttributeDefinition.INTEGER:
                return Integer.parseInt(value);

            case AttributeDefinition.LONG:
                return Long.parseLong(value);

            case AttributeDefinition.SHORT:
                return Short.parseShort(value);

            case AttributeDefinition.STRING:
                return value;

            default:
                throw new IllegalArgumentException("Invalid type argument: " + type);
        }

    }
/**
     * Converts String attribute value (from a metatype attribute definition) to what it is specified to be.
     * 
     * @param type
     *            the {@link AttributeDefinition} type
     * @param value
     *            the value that this attribute represents
     * @return parsed string of the desired type
     */
Converts String attribute value (from a metatype attribute definition) to what it is specified to be.

@param type
the  AttributeDefinition type
@param value
the value that this attribute represents
@return parsed string of the desired type
Converts String attribute value ( from a metatype attribute definition ) to what it is specified to be . @param type the AttributeDefinition type @param value the value that this attribute represents @return parsed string of the desired type
public static Object parseStringByType(final int type, final String value)
    {
        switch (type)
        {
            case AttributeDefinition.BOOLEAN:
                return Boolean.parseBoolean(value);
            case AttributeDefinition.BYTE:
                return Byte.parseByte(value);
            case AttributeDefinition.CHARACTER:
                return value.charAt(0);
            case AttributeDefinition.DOUBLE:
                return Double.parseDouble(value);
            case AttributeDefinition.FLOAT:
                return Float.parseFloat(value);
            case AttributeDefinition.INTEGER:
                return Integer.parseInt(value);
            case AttributeDefinition.LONG:
                return Long.parseLong(value);
            case AttributeDefinition.SHORT:
                return Short.parseShort(value);
            case AttributeDefinition.STRING:
                return value;
            default:
                throw new IllegalArgumentException("Invalid type argument: " + type);
        }
    }
public static Object parseStringByType ( final int type , final String value ) { switch ( type ) { case AttributeDefinition . BOOLEAN : return Boolean . parseBoolean ( value ) ; case AttributeDefinition . BYTE : return Byte . parseByte ( value ) ; case AttributeDefinition . CHARACTER : return value . charAt ( 0 ) ; case AttributeDefinition . DOUBLE : return Double . parseDouble ( value ) ; case AttributeDefinition . FLOAT : return Float . parseFloat ( value ) ; case AttributeDefinition . INTEGER : return Integer . parseInt ( value ) ; case AttributeDefinition . LONG : return Long . parseLong ( value ) ; case AttributeDefinition . SHORT : return Short . parseShort ( value ) ; case AttributeDefinition . STRING : return value ; default : throw new IllegalArgumentException ( "Invalid type argument: " + type ) ; } }
Converts String attribute value (from a metatype attribute definition) to what it is specified to be.
Converts String attribute value ( from a metatype attribute definition ) to what it is specified to be .