@Test(expected = IllegalArgumentException.class) public void testPluckBucketName_invalidKey() { Map<String, Object> bucket = new HashMap<>(); bucket.put("invalid", "invalid"); this.geohashGrid.pluckBucketName(bucket); }
String pluckBucketName(Map<String, Object> bucket) { if (!bucket.containsKey(BUCKET_NAME_KEY)) { LOGGER.warning( "Unable to pluck key, bucket does not contain required field:" + BUCKET_NAME_KEY); throw new IllegalArgumentException(); } return bucket.get(BUCKET_NAME_KEY) + ""; }
GeoHashGrid { String pluckBucketName(Map<String, Object> bucket) { if (!bucket.containsKey(BUCKET_NAME_KEY)) { LOGGER.warning( "Unable to pluck key, bucket does not contain required field:" + BUCKET_NAME_KEY); throw new IllegalArgumentException(); } return bucket.get(BUCKET_NAME_KEY) + ""; } }
GeoHashGrid { String pluckBucketName(Map<String, Object> bucket) { if (!bucket.containsKey(BUCKET_NAME_KEY)) { LOGGER.warning( "Unable to pluck key, bucket does not contain required field:" + BUCKET_NAME_KEY); throw new IllegalArgumentException(); } return bucket.get(BUCKET_NAME_KEY) + ""; } GeoHashGrid(); }
GeoHashGrid { String pluckBucketName(Map<String, Object> bucket) { if (!bucket.containsKey(BUCKET_NAME_KEY)) { LOGGER.warning( "Unable to pluck key, bucket does not contain required field:" + BUCKET_NAME_KEY); throw new IllegalArgumentException(); } return bucket.get(BUCKET_NAME_KEY) + ""; } GeoHashGrid(); void initalize(ReferencedEnvelope srcEnvelope, SimpleFeatureCollection features); GridCoverage2D toGridCoverage2D(); void setParams(List<String> params); void setEmptyCellValue(Float value); double getCellWidth(); double getCellHeight(); Envelope getEnvelope(); ReferencedEnvelope getBoundingBox(); float[][] getGrid(); void setScale(RasterScale scale); }
GeoHashGrid { String pluckBucketName(Map<String, Object> bucket) { if (!bucket.containsKey(BUCKET_NAME_KEY)) { LOGGER.warning( "Unable to pluck key, bucket does not contain required field:" + BUCKET_NAME_KEY); throw new IllegalArgumentException(); } return bucket.get(BUCKET_NAME_KEY) + ""; } GeoHashGrid(); void initalize(ReferencedEnvelope srcEnvelope, SimpleFeatureCollection features); GridCoverage2D toGridCoverage2D(); void setParams(List<String> params); void setEmptyCellValue(Float value); double getCellWidth(); double getCellHeight(); Envelope getEnvelope(); ReferencedEnvelope getBoundingBox(); float[][] getGrid(); void setScale(RasterScale scale); static final String BUCKET_NAME_KEY; static final String BUCKETS_KEY; static final String DOC_COUNT_KEY; static final String VALUE_KEY; }