Skip to content

Commit

Permalink
Fixes from spec 2552
Browse files Browse the repository at this point in the history
  • Loading branch information
l-trotta committed May 28, 2024
1 parent 9b719ae commit f8e1bea
Show file tree
Hide file tree
Showing 13 changed files with 701 additions and 175 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,7 @@ public String toString() {
return JsonpUtils.toString(this);
}

public static class Builder extends WithJsonObjectBuilderBase<Builder> {
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<Aggregation> {
private Kind _kind;
private Object _value;
private String _customKind;
Expand Down Expand Up @@ -2557,7 +2557,7 @@ public ContainerBuilder _custom(String name, Object data) {
return new ContainerBuilder();
}

protected Aggregation build() {
public Aggregation build() {
_checkSingleUse();
return new Aggregation(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Double;
import java.lang.String;
import java.util.Objects;
import java.util.function.Function;
Expand Down Expand Up @@ -60,13 +61,13 @@
@JsonpDeserializable
public class AggregationRange implements JsonpSerializable {
@Nullable
private final String from;
private final Double from;

@Nullable
private final String key;

@Nullable
private final String to;
private final Double to;

// ---------------------------------------------------------------------------------------------

Expand All @@ -88,7 +89,7 @@ public static AggregationRange of(Function<Builder, ObjectBuilder<AggregationRan
* API name: {@code from}
*/
@Nullable
public final String from() {
public final Double from() {
return this.from;
}

Expand All @@ -108,7 +109,7 @@ public final String key() {
* API name: {@code to}
*/
@Nullable
public final String to() {
public final Double to() {
return this.to;
}

Expand Down Expand Up @@ -154,20 +155,20 @@ public String toString() {

public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<AggregationRange> {
@Nullable
private String from;
private Double from;

@Nullable
private String key;

@Nullable
private String to;
private Double to;

/**
* Start of the range (inclusive).
* <p>
* API name: {@code from}
*/
public final Builder from(@Nullable String value) {
public final Builder from(@Nullable Double value) {
this.from = value;
return this;
}
Expand All @@ -187,7 +188,7 @@ public final Builder key(@Nullable String value) {
* <p>
* API name: {@code to}
*/
public final Builder to(@Nullable String value) {
public final Builder to(@Nullable Double value) {
this.to = value;
return this;
}
Expand Down Expand Up @@ -220,9 +221,9 @@ public AggregationRange build() {

protected static void setupAggregationRangeDeserializer(ObjectDeserializer<AggregationRange.Builder> op) {

op.add(Builder::from, JsonpDeserializer.stringDeserializer(), "from");
op.add(Builder::from, JsonpDeserializer.doubleDeserializer(), "from");
op.add(Builder::key, JsonpDeserializer.stringDeserializer(), "key");
op.add(Builder::to, JsonpDeserializer.stringDeserializer(), "to");
op.add(Builder::to, JsonpDeserializer.doubleDeserializer(), "to");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ protected static void setupNormalizerDeserializer(ObjectDeserializer<Builder> op
op.add(Builder::custom, CustomNormalizer._DESERIALIZER, "custom");
op.add(Builder::lowercase, LowercaseNormalizer._DESERIALIZER, "lowercase");

op.setTypeProperty("type", null);
op.setTypeProperty("type", "custom");

}

Expand Down
Loading

0 comments on commit f8e1bea

Please sign in to comment.