private GeoResult < ? > buildGeoResult ( final ArangoCursor < ? > cursor ) { GeoResult < ? > geoResult = null ; while ( cursor . hasNext ( ) && geoResult == null ) { final Object object = cursor . next ( ) ; if ( ! ( object instanceof VPackSlice ) ) { continue ; } final VPackSlice slice = ( VPackSlice ) object ; final VPackSlice distSlice = slice . get ( "_distance" ) ; final Double distanceInMeters = distSlice . isDouble ( ) ? distSlice . getAsDouble ( ) : null ; if ( distanceInMeters == null ) { continue ; } final Object entity = operations . getConverter ( ) . read ( domainClass , slice ) ; final Distance distance = new Distance ( distanceInMeters / 1000 , Metrics . KILOMETERS ) ; geoResult = new GeoResult <> ( entity , distance ) ; } return geoResult ; }
Build a GeoResult from the given ArangoCursor