return new TextValue(null, null);
} else {
if (value instanceof Boolean) {
return new BooleanValue(null, (Boolean) value);
} else if (value instanceof Double) {
return new NumberValue(null, value.toString());
} else if (value instanceof String) {
return new TextValue(null, (String) value);
} else if (value instanceof Long) {
return new NumberValue(null, value.toString());
} else if (value instanceof DateTime) {
return new DateTimeValue(null, (DateTime) value);
} else {
throw new IllegalArgumentException("Unexpected Value type ["
+ value.getClass() + "]");