return new LocationField(fieldName, new Location(latVal, lonVal)); } else {
@Test public void testLocationFieldSubObjectArray() { testNestedFieldArraySubObject( new LocationField( "name", new Location( 10, 20 ) ), ( field, entityField ) -> { final Map<String, Double> latLong = ( Map<String, Double> ) entityField.get( IndexingUtils.FIELD_LOCATION ); assertEquals( Double.valueOf( 10 ), latLong.get("lat" ) ); assertEquals( Double.valueOf( 20 ), latLong.get("lon" ) ); } ); }
@Test public void testLocationField() { testSingleField( new LocationField( "Name", new Location( 10, 20 ) ), ( field, entityField ) -> { final Map<String, Double> latLong = ( Map<String, Double> ) entityField.get( IndexingUtils.FIELD_LOCATION ); assertEquals( Double.valueOf( 10 ), latLong.get( "lat" ) ); assertEquals( Double.valueOf( 20 ), latLong.get( "lon" ) ); } ); }
@Test public void testLocationFieldSubObject() { testNestedField( new LocationField( "name", new Location( 10, 20 ) ), ( field, entityField ) -> { final Map<String, Double> latLong = ( Map<String, Double> ) entityField.get( IndexingUtils.FIELD_LOCATION ); assertEquals( Double.valueOf( 10 ), latLong.get( "lat" ) ); assertEquals( Double.valueOf( 20 ), latLong.get( "lon" ) ); } ); }
field = new LocationField( fieldName, new Location( lat, lon ));
newEntity.setField(new LocationField("location", new Location(120,40)));
cat.setField( new LocationField("location", new Location(37.0 + i , -75.0 + i ) ) ); cats[i] = cat;