@Test public void testGetValueEmptyList() { final BasicDBList list = new BasicDBList(); Object value = MongoComplexUtilities.getValue(list, Collections.emptyMap(), "path1.path2"); assertTrue(value == null); }
public static Object getValue(Object object, String jsonPath) { Feature feature = extractFeature(object, jsonPath); if (feature instanceof MongoFeature) { MongoFeature mongoFeature = (MongoFeature) feature; return getValue(mongoFeature.getMongoObject(), jsonPath); } if (feature instanceof MongoCollectionFeature) { MongoCollectionFeature collectionFeature = (MongoCollectionFeature) object; return getValue( collectionFeature.getMongoFeature().getMongoObject(), collectionFeature.getCollectionsIndexes(), jsonPath); } throw invalidFeature(feature, jsonPath); }
MongoComplexUtilities { public static Object getValue(Object object, String jsonPath) { Feature feature = extractFeature(object, jsonPath); if (feature instanceof MongoFeature) { MongoFeature mongoFeature = (MongoFeature) feature; return getValue(mongoFeature.getMongoObject(), jsonPath); } if (feature instanceof MongoCollectionFeature) { MongoCollectionFeature collectionFeature = (MongoCollectionFeature) object; return getValue( collectionFeature.getMongoFeature().getMongoObject(), collectionFeature.getCollectionsIndexes(), jsonPath); } throw invalidFeature(feature, jsonPath); } }
MongoComplexUtilities { public static Object getValue(Object object, String jsonPath) { Feature feature = extractFeature(object, jsonPath); if (feature instanceof MongoFeature) { MongoFeature mongoFeature = (MongoFeature) feature; return getValue(mongoFeature.getMongoObject(), jsonPath); } if (feature instanceof MongoCollectionFeature) { MongoCollectionFeature collectionFeature = (MongoCollectionFeature) object; return getValue( collectionFeature.getMongoFeature().getMongoObject(), collectionFeature.getCollectionsIndexes(), jsonPath); } throw invalidFeature(feature, jsonPath); } private  MongoComplexUtilities(); }
MongoComplexUtilities { public static Object getValue(Object object, String jsonPath) { Feature feature = extractFeature(object, jsonPath); if (feature instanceof MongoFeature) { MongoFeature mongoFeature = (MongoFeature) feature; return getValue(mongoFeature.getMongoObject(), jsonPath); } if (feature instanceof MongoCollectionFeature) { MongoCollectionFeature collectionFeature = (MongoCollectionFeature) object; return getValue( collectionFeature.getMongoFeature().getMongoObject(), collectionFeature.getCollectionsIndexes(), jsonPath); } throw invalidFeature(feature, jsonPath); } private  MongoComplexUtilities(); static String resolvePath(Feature feature, String jsonPath); static void setParentPath(Feature feature, String parentPath); static Object getValue(Object object, String jsonPath); static Feature extractFeature(Object feature, String jsonPath); static Object getValue(DBObject mongoObject, String jsonPath); static Object getValue(
            DBObject mongoObject, Map<String, Integer> collectionsIndexes, String jsonPath); static Object getValues(Object object, String jsonPath); static Object getValues(DBObject dbObject, String jsonPath); static Map<String, Class> findMappings(DBObject dbObject); static Map<String, Class> findMappings(DBCursor cursor); }
MongoComplexUtilities { public static Object getValue(Object object, String jsonPath) { Feature feature = extractFeature(object, jsonPath); if (feature instanceof MongoFeature) { MongoFeature mongoFeature = (MongoFeature) feature; return getValue(mongoFeature.getMongoObject(), jsonPath); } if (feature instanceof MongoCollectionFeature) { MongoCollectionFeature collectionFeature = (MongoCollectionFeature) object; return getValue( collectionFeature.getMongoFeature().getMongoObject(), collectionFeature.getCollectionsIndexes(), jsonPath); } throw invalidFeature(feature, jsonPath); } private  MongoComplexUtilities(); static String resolvePath(Feature feature, String jsonPath); static void setParentPath(Feature feature, String parentPath); static Object getValue(Object object, String jsonPath); static Feature extractFeature(Object feature, String jsonPath); static Object getValue(DBObject mongoObject, String jsonPath); static Object getValue(
            DBObject mongoObject, Map<String, Integer> collectionsIndexes, String jsonPath); static Object getValues(Object object, String jsonPath); static Object getValues(DBObject dbObject, String jsonPath); static Map<String, Class> findMappings(DBObject dbObject); static Map<String, Class> findMappings(DBCursor cursor); static final String MONGO_PARENT_PATH; }