if (type == Type.BOOLEAN) {
return (T) Boolean.valueOf(converter.toBoolean());
} else if (type == Type.DECIMAL) {
return (T) converter.toDecimal();
} else if (type == Type.DOUBLE) {
return (T) Double.valueOf(converter.toDouble());
} else if (type == Type.LONG) {
return (T) Long.valueOf(converter.toLong());
} else {
throw new UnsupportedOperationException(
"Unknown type: " + type);