@Nullable @SuppressWarnings("unchecked") private <T> T potentiallyReadOrResolveDbRef(@Nullable DBRef dbref, TypeInformation<?> type, ObjectPath path, Class<?> rawType) { if (rawType.equals(DBRef.class)) { return (T) dbref; } T object = dbref == null ? null : path.getPathItem(dbref.getId(), dbref.getCollectionName(), (Class<T>) rawType); return object != null ? object : readAndConvertDBRef(dbref, type, path, rawType); }
@Nullable @SuppressWarnings("unchecked") private <T> T potentiallyReadOrResolveDbRef(@Nullable DBRef dbref, TypeInformation<?> type, ObjectPath path, Class<?> rawType) { if (rawType.equals(DBRef.class)) { return (T) dbref; } T object = dbref == null ? null : path.getPathItem(dbref.getId(), dbref.getCollectionName(), (Class<T>) rawType); return object != null ? object : readAndConvertDBRef(dbref, type, path, rawType); }