@Nullable @SuppressWarnings("unchecked") <T> T readValue(Object value, TypeInformation<?> type, ObjectPath path) { Class<?> rawType = type.getType(); if (conversions.hasCustomReadTarget(value.getClass(), rawType)) { return (T) conversionService.convert(value, rawType); } else if (value instanceof DBRef) { return potentiallyReadOrResolveDbRef((DBRef) value, type, path, rawType); } else if (value instanceof List) { return (T) readCollectionOrArray(type, (List<Object>) value, path); } else if (value instanceof Document) { return (T) read(type, (Document) value, path); } else if (value instanceof DBObject) { return (T) read(type, (BasicDBObject) value, path); } else { return (T) getPotentiallyConvertedSimpleRead(value, rawType); } }
: readAndConvertDBRef((DBRef) value, defaultedValueType, ObjectPath.ROOT, rawValueType)); } else if (value instanceof List) { map.put(key, readCollectionOrArray(valueType != null ? valueType : ClassTypeInformation.LIST, (List<Object>) value, path)); } else {
return (S) readCollectionOrArray(typeToUse, (List<?>) bson, path);
items.add(readCollectionOrArray(componentType, (Collection<Object>) element, path)); } else { items.add(getPotentiallyConvertedSimpleRead(element, rawComponentType));
: readAndConvertDBRef((DBRef) value, defaultedValueType, ObjectPath.ROOT, rawValueType)); } else if (value instanceof List) { map.put(key, readCollectionOrArray(valueType != null ? valueType : ClassTypeInformation.LIST, (List<Object>) value, path)); } else {
@Nullable @SuppressWarnings("unchecked") <T> T readValue(Object value, TypeInformation<?> type, ObjectPath path) { Class<?> rawType = type.getType(); if (conversions.hasCustomReadTarget(value.getClass(), rawType)) { return (T) conversionService.convert(value, rawType); } else if (value instanceof DBRef) { return potentiallyReadOrResolveDbRef((DBRef) value, type, path, rawType); } else if (value instanceof List) { return (T) readCollectionOrArray(type, (List<Object>) value, path); } else if (value instanceof Document) { return (T) read(type, (Document) value, path); } else if (value instanceof DBObject) { return (T) read(type, (BasicDBObject) value, path); } else { return (T) getPotentiallyConvertedSimpleRead(value, rawType); } }
return (S) readCollectionOrArray(typeToUse, (List<?>) bson, path);
items.add(readCollectionOrArray(componentType, (Collection<Object>) element, path)); } else { items.add(getPotentiallyConvertedSimpleRead(element, rawComponentType));