return new SimpleValueSupport(st,value.charAt(0));
} else if (SimpleMetaType.DATE.equals(st)) {
try {
return new SimpleValueSupport(st, SimpleDateFormat.getInstance().parse(value));
} catch (ParseException e) {
throw new TeiidRuntimeException(e, IntegrationPlugin.Util.getString("failed_to_convert", type.getClassName())); //$NON-NLS-1$
}
} else if (SimpleMetaType.DOUBLE.equals(st)) {
return new SimpleValueSupport(st, Double.valueOf(value));
} else if (SimpleMetaType.DOUBLE_PRIMITIVE.equals(st)) {
return new SimpleValueSupport(st, Double.parseDouble(value));
} else if (SimpleMetaType.FLOAT.equals(st)) {
return new SimpleValueSupport(st, Float.parseFloat(value));
} else if (SimpleMetaType.FLOAT_PRIMITIVE.equals(st)) {
return new SimpleValueSupport(st, Float.valueOf(value));
} else if (SimpleMetaType.INTEGER.equals(st)) {
return new SimpleValueSupport(st, Integer.valueOf(value));
} else if (SimpleMetaType.INTEGER_PRIMITIVE.equals(st)) {
return new SimpleValueSupport(st, Integer.parseInt(value));
} else if (SimpleMetaType.LONG.equals(st)) {
return new SimpleValueSupport(st, Long.valueOf(value));
} else if (SimpleMetaType.LONG_PRIMITIVE.equals(st)) {
return new SimpleValueSupport(st, Long.parseLong(value));
} else if (SimpleMetaType.SHORT.equals(st)) {
return new SimpleValueSupport(st, Short.valueOf(value));
} else if (SimpleMetaType.SHORT_PRIMITIVE.equals(st)) {
return new SimpleValueSupport(st, Short.parseShort(value));
} else if (SimpleMetaType.STRING.equals(st)) {
return new SimpleValueSupport(st,value);
}
}
throw new TeiidRuntimeException(IntegrationPlugin.Util.getString("failed_to_convert", type.getClassName())); //$NON-NLS-1$
}