/*
 * Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package in.zapr.druid.druidry.extensions.datasketches.postAggregator;

import com.fasterxml.jackson.annotation.JsonInclude;
import in.zapr.druid.druidry.postAggregator.DruidPostAggregator;
import lombok.Getter;
import lombok.NonNull;

@Getter
public class ThetaSketchEstimatePostAggregator extends DruidPostAggregator {

    private static final String THETA_SKETCH_ESTIMATE_POST_AGGREGATOR_TYPE = "thetaSketchEstimate";

    private DruidPostAggregator field;

    @JsonInclude(JsonInclude.Include.NON_DEFAULT)
    private int errorBoundsStdDev;

    public ThetaSketchEstimatePostAggregator(@NonNull String name,
                                             @NonNull DruidPostAggregator field) {
        this.type = THETA_SKETCH_ESTIMATE_POST_AGGREGATOR_TYPE;
        this.name = name;
        this.field = field;
    }

    public ThetaSketchEstimatePostAggregator(@NonNull String name,
                                             @NonNull DruidPostAggregator field,
                                             int errorBoundsStdDev) {
        this.type = THETA_SKETCH_ESTIMATE_POST_AGGREGATOR_TYPE;
        this.name = name;
        this.field = field;
        this.errorBoundsStdDev = errorBoundsStdDev;
    }

}

@@ -819,16 +819,39 @@
 egator;%0A
+import lombok.Builder;%0A
 import l
@@ -896,16 +896,59 @@
 @Getter%0A
+@JsonInclude(JsonInclude.Include.NON_NULL)%0A
 public c
@@ -1117,17 +1117,16 @@
 imate%22;%0A
-%0A
     priv
@@ -1159,59 +1159,8 @@
 eld;
-%0A%0A    @JsonInclude(JsonInclude.Include.NON_DEFAULT)
 %0A   
@@ -1168,19 +1168,23 @@
 private 
-i
+I
 nt
+eger
  errorBo
@@ -1196,16 +1196,29 @@
 tdDev;%0A%0A
+    @Builder%0A
     publ
@@ -1246,32 +1246,45 @@
 ePostAggregator(
+%0A            
 @NonNull String 
@@ -1293,316 +1293,8 @@
 me,%0A
-                                             @NonNull DruidPostAggregator field) %7B%0A        this.type = THETA_SKETCH_ESTIMATE_POST_AGGREGATOR_TYPE;%0A        this.name = name;%0A        this.field = field;%0A    %7D%0A%0A    public ThetaSketchEstimatePostAggregator(@NonNull String name,%0A                                 
     
@@ -1353,44 +1353,15 @@
     
-                                 int
+Integer
  err

use builder, remove primitive, change jackson annotation