} 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 if (value instanceof Date) {
return new DateValue(null, (Date) value);
} else {
throw new IllegalArgumentException("Unexpected Value type ["
+ value.getClass() + "]");