Skip to content

Commit

Permalink
Add withJson() to populate builders from JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
swallez committed Mar 14, 2022
1 parent 1be4c36 commit 7a94cae
Show file tree
Hide file tree
Showing 1,338 changed files with 10,545 additions and 2,647 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.ObjectBuilderBase;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Boolean;
import java.util.Objects;
Expand Down Expand Up @@ -83,7 +83,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

protected abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<BuilderT>>
extends
ObjectBuilderBase {
WithJsonObjectBuilderBase<BuilderT> {
private Boolean acknowledged;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.ObjectBuilderBase;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.String;
import java.util.List;
Expand Down Expand Up @@ -162,7 +162,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

protected abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<BuilderT>>
extends
ObjectBuilderBase {
WithJsonObjectBuilderBase<BuilderT> {
private Map<String, String> attributes;

private String host;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.ObjectBuilderBase;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Integer;
import java.lang.String;
Expand Down Expand Up @@ -143,7 +143,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
* Builder for {@link BulkIndexByScrollFailure}.
*/

public static class Builder extends ObjectBuilderBase implements ObjectBuilder<BulkIndexByScrollFailure> {
public static class Builder extends WithJsonObjectBuilderBase<Builder>
implements
ObjectBuilder<BulkIndexByScrollFailure> {
private ErrorCause cause;

private String id;
Expand Down Expand Up @@ -201,6 +203,11 @@ public final Builder type(String value) {
return this;
}

@Override
protected Builder self() {
return this;
}

/**
* Builds a {@link BulkIndexByScrollFailure}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.ObjectBuilderBase;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Long;
import java.lang.String;
Expand Down Expand Up @@ -211,7 +211,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
* Builder for {@link BulkStats}.
*/

public static class Builder extends ObjectBuilderBase implements ObjectBuilder<BulkStats> {
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<BulkStats> {
private Long totalOperations;

@Nullable
Expand Down Expand Up @@ -306,6 +306,11 @@ public final Builder avgSizeInBytes(long value) {
return this;
}

@Override
protected Builder self() {
return this;
}

/**
* Builds a {@link BulkStats}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.ObjectBuilderBase;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Integer;
import java.util.Objects;
Expand Down Expand Up @@ -115,7 +115,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
* Builder for {@link ClusterStatistics}.
*/

public static class Builder extends ObjectBuilderBase implements ObjectBuilder<ClusterStatistics> {
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<ClusterStatistics> {
private Integer skipped;

private Integer successful;
Expand Down Expand Up @@ -146,6 +146,11 @@ public final Builder total(int value) {
return this;
}

@Override
protected Builder self() {
return this;
}

/**
* Builds a {@link ClusterStatistics}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.ObjectBuilderBase;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Long;
import java.lang.String;
Expand Down Expand Up @@ -131,7 +131,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
* Builder for {@link CompletionStats}.
*/

public static class Builder extends ObjectBuilderBase implements ObjectBuilder<CompletionStats> {
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<CompletionStats> {
private Long sizeInBytes;

@Nullable
Expand Down Expand Up @@ -185,6 +185,11 @@ public final Builder fields(String key, Function<FieldSizeUsage.Builder, ObjectB
return fields(key, fn.apply(new FieldSizeUsage.Builder()).build());
}

@Override
protected Builder self() {
return this;
}

/**
* Builds a {@link CompletionStats}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.ObjectBuilderBase;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Double;
import java.util.Objects;
Expand Down Expand Up @@ -128,7 +128,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
* Builder for {@link CoordsGeoBounds}.
*/

public static class Builder extends ObjectBuilderBase implements ObjectBuilder<CoordsGeoBounds> {
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<CoordsGeoBounds> {
private Double top;

private Double bottom;
Expand Down Expand Up @@ -169,6 +169,11 @@ public final Builder right(double value) {
return this;
}

@Override
protected Builder self() {
return this;
}

/**
* Builds a {@link CoordsGeoBounds}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.ObjectBuilderBase;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Long;
import java.util.Objects;
Expand Down Expand Up @@ -108,7 +108,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
* Builder for {@link DocStats}.
*/

public static class Builder extends ObjectBuilderBase implements ObjectBuilder<DocStats> {
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<DocStats> {
private Long count;

@Nullable
Expand All @@ -130,6 +130,11 @@ public final Builder deleted(@Nullable Long value) {
return this;
}

@Override
protected Builder self() {
return this;
}

/**
* Builds a {@link DocStats}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.DateTime;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.ObjectBuilderBase;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Boolean;
import java.lang.String;
Expand Down Expand Up @@ -197,7 +197,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
* Builder for {@link ElasticsearchVersionInfo}.
*/

public static class Builder extends ObjectBuilderBase implements ObjectBuilder<ElasticsearchVersionInfo> {
public static class Builder extends WithJsonObjectBuilderBase<Builder>
implements
ObjectBuilder<ElasticsearchVersionInfo> {
private DateTime buildDate;

private String buildFlavor;
Expand Down Expand Up @@ -288,6 +290,11 @@ public final Builder number(String value) {
return this;
}

@Override
protected Builder self() {
return this;
}

/**
* Builds a {@link ElasticsearchVersionInfo}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.ObjectBuilderBase;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.String;
import java.util.HashMap;
Expand Down Expand Up @@ -213,7 +213,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
* Builder for {@link ErrorCause}.
*/

public static class Builder extends ObjectBuilderBase implements ObjectBuilder<ErrorCause> {
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<ErrorCause> {
@Nullable
private Map<String, JsonData> metadata = new HashMap<>();

Expand Down Expand Up @@ -358,6 +358,11 @@ public final Builder suppressed(Function<ErrorCause.Builder, ObjectBuilder<Error
return suppressed(fn.apply(new ErrorCause.Builder()).build());
}

@Override
protected Builder self() {
return this;
}

/**
* Builds a {@link ErrorCause}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.ObjectBuilderBase;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Integer;
import java.util.Objects;
Expand Down Expand Up @@ -105,7 +105,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
* Builder for {@link ErrorResponse}.
*/

public static class Builder extends ObjectBuilderBase implements ObjectBuilder<ErrorResponse> {
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<ErrorResponse> {
private ErrorCause error;

private Integer status;
Expand Down Expand Up @@ -133,6 +133,11 @@ public final Builder status(int value) {
return this;
}

@Override
protected Builder self() {
return this;
}

/**
* Builds a {@link ErrorResponse}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.ObjectBuilderBase;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Long;
import java.lang.String;
Expand Down Expand Up @@ -108,7 +108,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
* Builder for {@link FieldMemoryUsage}.
*/

public static class Builder extends ObjectBuilderBase implements ObjectBuilder<FieldMemoryUsage> {
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<FieldMemoryUsage> {
@Nullable
private String memorySize;

Expand All @@ -130,6 +130,11 @@ public final Builder memorySizeInBytes(long value) {
return this;
}

@Override
protected Builder self() {
return this;
}

/**
* Builds a {@link FieldMemoryUsage}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.ObjectBuilderBase;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Long;
import java.lang.String;
Expand Down Expand Up @@ -108,7 +108,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
* Builder for {@link FieldSizeUsage}.
*/

public static class Builder extends ObjectBuilderBase implements ObjectBuilder<FieldSizeUsage> {
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<FieldSizeUsage> {
@Nullable
private String size;

Expand All @@ -130,6 +130,11 @@ public final Builder sizeInBytes(long value) {
return this;
}

@Override
protected Builder self() {
return this;
}

/**
* Builds a {@link FieldSizeUsage}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.ObjectBuilderBase;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.String;
import java.util.Objects;
Expand Down Expand Up @@ -209,7 +209,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
* Builder for {@link FieldSort}.
*/

public static class Builder extends ObjectBuilderBase implements ObjectBuilder<FieldSort> {
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<FieldSort> {
private String field;

/**
Expand Down Expand Up @@ -343,6 +343,11 @@ public final Builder format(@Nullable String value) {
return this;
}

@Override
protected Builder self() {
return this;
}

/**
* Builds a {@link FieldSort}.
*
Expand Down
Loading

0 comments on commit 7a94cae

Please sign in to comment.