@Test public void fullMapToEntityConversion() { final Map<String,Object> data = new HashMap<>(1); final String stringField = "stringFieldValue"; final List<String> listField = new ArrayList<>(1); listField.add("listFieldValue"); final boolean booleanField = true; final double doubleField = new Double("1"); final int intField = 2; final long longField = 3L; final float floatField = new Float("4"); final Map<String, Double> coordinates = new HashMap<>(2); coordinates.put("latitude", 37.3338716); coordinates.put("longitude", -121.894249); final Map<String, Object> objectField = new HashMap<>(1); objectField.put("key1", "value1"); data.put("stringField", stringField); data.put("listField", listField); data.put("booleanField", booleanField); data.put("doubleField", doubleField); data.put("intField", intField); data.put("longField", longField); data.put("floatField", floatField); data.put("location", coordinates); data.put("objectField", objectField); data.put("nullField", null); MapToEntityConverter converter = new MapToEntityConverter(); Entity entity = converter.fromMap(data, true); assertTrue(entity.getField("stringField").getTypeName() == FieldTypeName.STRING); assertTrue(entity.getField("listField").getTypeName() == FieldTypeName.LIST); assertTrue(entity.getField("booleanField").getTypeName() == FieldTypeName.BOOLEAN); assertTrue(entity.getField("doubleField").getTypeName() == FieldTypeName.DOUBLE); assertTrue(entity.getField("intField").getTypeName() == FieldTypeName.INTEGER); assertTrue(entity.getField("longField").getTypeName() == FieldTypeName.LONG); assertTrue(entity.getField("floatField").getTypeName() == FieldTypeName.FLOAT); assertTrue(entity.getField("location").getTypeName() == FieldTypeName.LOCATION); assertTrue(entity.getField("objectField").getTypeName() == FieldTypeName.OBJECT); assertTrue(entity.getField("nullField").getTypeName() == FieldTypeName.NULL); }
public Entity fromMap( Map<String, Object> map, boolean topLevel ) { Entity entity = new Entity(); return fromMap( entity, map, null, null, topLevel ); }
MapToEntityConverter { public Entity fromMap( Map<String, Object> map, boolean topLevel ) { Entity entity = new Entity(); return fromMap( entity, map, null, null, topLevel ); } }
MapToEntityConverter { public Entity fromMap( Map<String, Object> map, boolean topLevel ) { Entity entity = new Entity(); return fromMap( entity, map, null, null, topLevel ); }  }
MapToEntityConverter { public Entity fromMap( Map<String, Object> map, boolean topLevel ) { Entity entity = new Entity(); return fromMap( entity, map, null, null, topLevel ); }  Entity fromMap( Map<String, Object> map,  boolean topLevel ); Entity fromMap(final Entity entity,final  Map<String, Object> map,final
        SchemaManager schemaManager, final String entityType, boolean topLevel); }
MapToEntityConverter { public Entity fromMap( Map<String, Object> map, boolean topLevel ) { Entity entity = new Entity(); return fromMap( entity, map, null, null, topLevel ); }  Entity fromMap( Map<String, Object> map,  boolean topLevel ); Entity fromMap(final Entity entity,final  Map<String, Object> map,final
        SchemaManager schemaManager, final String entityType, boolean topLevel); static final Logger logger; }