@@ -0,0 +1,3289 @@
+package io.searchbox.core.search.aggregation;%0A%0Aimport com.google.gson.JsonArray;%0Aimport com.google.gson.JsonElement;%0Aimport com.google.gson.JsonObject;%0Aimport org.apache.commons.lang3.builder.EqualsBuilder;%0Aimport org.apache.commons.lang3.builder.HashCodeBuilder;%0A%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0A%0Aimport static io.searchbox.core.search.aggregation.AggregationField.*;%0A%0A/**%0A * @author cfstout%0A */%0Apublic class GeoHashGridAggregation extends BucketAggregation%7B%0A%0A    public static final String TYPE = %22geohash_grid%22;%0A%0A    private List%3CGeoHashGrid%3E geoHashGrids = new LinkedList%3CGeoHashGrid%3E();%0A%0A    public GeoHashGridAggregation(String name, JsonObject geohashGridAggregation) %7B%0A        super(name, geohashGridAggregation);%0A        if(geohashGridAggregation.has(String.valueOf(BUCKETS)) && geohashGridAggregation.get(String.valueOf(BUCKETS)).isJsonArray()) %7B%0A            parseBuckets(geohashGridAggregation.get(String.valueOf(BUCKETS)).getAsJsonArray());%0A        %7D%0A    %7D%0A%0A    private void parseBuckets(JsonArray bucketsSource) %7B%0A        for (JsonElement bucketElement : bucketsSource) %7B%0A            JsonObject bucket = bucketElement.getAsJsonObject();%0A            GeoHashGrid geoHashGrid = new GeoHashGrid(%0A                    bucket,%0A                    bucket.get(String.valueOf(KEY)).getAsString(),%0A                    bucket.get(String.valueOf(DOC_COUNT)).getAsLong());%0A            geoHashGrids.add(geoHashGrid);%0A        %7D%0A    %7D%0A%0A    public List%3CGeoHashGrid%3E getBuckets() %7B%0A        return geoHashGrids;%0A    %7D%0A%0A    public static class GeoHashGrid extends Bucket %7B%0A        private String key;%0A%0A        public GeoHashGrid(JsonObject bucket, String key, Long count) %7B%0A            super(bucket, count);%0A            this.key = key;%0A        %7D%0A%0A        public String getKey() %7B%0A            return key;%0A        %7D%0A%0A        @Override%0A        public boolean equals(Object obj) %7B%0A            if (obj == null) %7B%0A                return false;%0A            %7D%0A            if (obj == this) %7B%0A                return true;%0A            %7D%0A            if (obj.getClass() != getClass()) %7B%0A                return false;%0A            %7D%0A%0A            GeoHashGrid rhs = (GeoHashGrid) obj;%0A            return new EqualsBuilder()%0A                    .appendSuper(super.equals(obj))%0A                    .append(key, rhs.key)%0A                    .isEquals();%0A        %7D%0A%0A        @Override%0A        public int hashCode() %7B%0A            return new HashCodeBuilder()%0A                    .appendSuper(super.hashCode())%0A                    .append(key)%0A                    .toHashCode();%0A        %7D%0A    %7D%0A%0A    @Override%0A    public boolean equals(Object obj) %7B%0A        if (obj == null) %7B%0A            return false;%0A        %7D%0A        if (obj == this) %7B%0A            return true;%0A        %7D%0A        if (obj.getClass() != getClass()) %7B%0A            return false;%0A        %7D%0A%0A        GeoHashGridAggregation rhs = (GeoHashGridAggregation) obj;%0A        return new EqualsBuilder()%0A                .appendSuper(super.equals(obj))%0A                .append(geoHashGrids, rhs.geoHashGrids)%0A                .isEquals();%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        return new HashCodeBuilder()%0A                .appendSuper(super.hashCode())%0A                .append(geoHashGrids)%0A                .toHashCode();%0A    %7D%0A%7D%0A

rename fix pt.2