if(valueType == null) {
throw new RestException(Status.BAD_REQUEST, String.format("Unsupported value type '%s'", type));
}
else {
if(valueType instanceof PrimitiveValueType) {
PrimitiveValueType primitiveValueType = (PrimitiveValueType) valueType;
Class<?> javaType = primitiveValueType.getJavaType();
Object mappedValue = null;
try {
if(value != null) {
if(javaType.isAssignableFrom(value.getClass())) {
mappedValue = value;