Skip to content

Commit c9f18df

Browse files
committed
Use primitive types for required properties
1 parent 788ab54 commit c9f18df

File tree

639 files changed

+3555
-3897
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

639 files changed

+3555
-3897
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/BulkResponse.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@
4545
// typedef: _global.bulk.Response
4646
@JsonpDeserializable
4747
public final class BulkResponse implements JsonpSerializable {
48-
private final Boolean errors;
48+
private final boolean errors;
4949

5050
private final List<ResponseItem> items;
5151

52-
private final Long took;
52+
private final long took;
5353

5454
@Nullable
5555
private final Long ingestTook;
@@ -68,7 +68,7 @@ public BulkResponse(Builder builder) {
6868
/**
6969
* API name: {@code errors}
7070
*/
71-
public Boolean errors() {
71+
public boolean errors() {
7272
return this.errors;
7373
}
7474

@@ -82,7 +82,7 @@ public List<ResponseItem> items() {
8282
/**
8383
* API name: {@code took}
8484
*/
85-
public Long took() {
85+
public long took() {
8686
return this.took;
8787
}
8888

@@ -146,7 +146,7 @@ public static class Builder implements ObjectBuilder<BulkResponse> {
146146
/**
147147
* API name: {@code errors}
148148
*/
149-
public Builder errors(Boolean value) {
149+
public Builder errors(boolean value) {
150150
this.errors = value;
151151
return this;
152152
}
@@ -195,7 +195,7 @@ public Builder addItems(Function<ResponseItem.Builder, ObjectBuilder<ResponseIte
195195
/**
196196
* API name: {@code took}
197197
*/
198-
public Builder took(Long value) {
198+
public Builder took(long value) {
199199
this.took = value;
200200
return this;
201201
}

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/ClearScrollResponse.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,13 @@
3535
import java.lang.Boolean;
3636
import java.lang.Integer;
3737
import java.util.Objects;
38-
import javax.annotation.Nullable;
3938

4039
// typedef: _global.clear_scroll.Response
4140
@JsonpDeserializable
4241
public final class ClearScrollResponse implements JsonpSerializable {
43-
private final Boolean succeeded;
42+
private final boolean succeeded;
4443

45-
private final Integer numFreed;
44+
private final int numFreed;
4645

4746
// ---------------------------------------------------------------------------------------------
4847

@@ -56,14 +55,14 @@ public ClearScrollResponse(Builder builder) {
5655
/**
5756
* API name: {@code succeeded}
5857
*/
59-
public Boolean succeeded() {
58+
public boolean succeeded() {
6059
return this.succeeded;
6160
}
6261

6362
/**
6463
* API name: {@code num_freed}
6564
*/
66-
public Integer numFreed() {
65+
public int numFreed() {
6766
return this.numFreed;
6867
}
6968

@@ -99,15 +98,15 @@ public static class Builder implements ObjectBuilder<ClearScrollResponse> {
9998
/**
10099
* API name: {@code succeeded}
101100
*/
102-
public Builder succeeded(Boolean value) {
101+
public Builder succeeded(boolean value) {
103102
this.succeeded = value;
104103
return this;
105104
}
106105

107106
/**
108107
* API name: {@code num_freed}
109108
*/
110-
public Builder numFreed(Integer value) {
109+
public Builder numFreed(int value) {
111110
this.numFreed = value;
112111
return this;
113112
}

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/ClosePointInTimeResponse.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,13 @@
3535
import java.lang.Boolean;
3636
import java.lang.Integer;
3737
import java.util.Objects;
38-
import javax.annotation.Nullable;
3938

4039
// typedef: _global.close_point_in_time.Response
4140
@JsonpDeserializable
4241
public final class ClosePointInTimeResponse implements JsonpSerializable {
43-
private final Boolean succeeded;
42+
private final boolean succeeded;
4443

45-
private final Integer numFreed;
44+
private final int numFreed;
4645

4746
// ---------------------------------------------------------------------------------------------
4847

@@ -56,14 +55,14 @@ public ClosePointInTimeResponse(Builder builder) {
5655
/**
5756
* API name: {@code succeeded}
5857
*/
59-
public Boolean succeeded() {
58+
public boolean succeeded() {
6059
return this.succeeded;
6160
}
6261

6362
/**
6463
* API name: {@code num_freed}
6564
*/
66-
public Integer numFreed() {
65+
public int numFreed() {
6766
return this.numFreed;
6867
}
6968

@@ -99,15 +98,15 @@ public static class Builder implements ObjectBuilder<ClosePointInTimeResponse> {
9998
/**
10099
* API name: {@code succeeded}
101100
*/
102-
public Builder succeeded(Boolean value) {
101+
public Builder succeeded(boolean value) {
103102
this.succeeded = value;
104103
return this;
105104
}
106105

107106
/**
108107
* API name: {@code num_freed}
109108
*/
110-
public Builder numFreed(Integer value) {
109+
public Builder numFreed(int value) {
111110
this.numFreed = value;
112111
return this;
113112
}

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/CountResponse.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
// typedef: _global.count.Response
4242
@JsonpDeserializable
4343
public final class CountResponse implements JsonpSerializable {
44-
private final Long count;
44+
private final long count;
4545

4646
private final ShardStatistics shards;
4747

@@ -57,7 +57,7 @@ public CountResponse(Builder builder) {
5757
/**
5858
* API name: {@code count}
5959
*/
60-
public Long count() {
60+
public long count() {
6161
return this.count;
6262
}
6363

@@ -100,7 +100,7 @@ public static class Builder implements ObjectBuilder<CountResponse> {
100100
/**
101101
* API name: {@code count}
102102
*/
103-
public Builder count(Long value) {
103+
public Builder count(long value) {
104104
this.count = value;
105105
return this;
106106
}

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/CreateRequest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,8 @@ protected static <TDocument> void setupCreateRequestDeserializer(
440440

441441
int propsSet = 0;
442442

443-
if (request.id() != null)
444-
propsSet |= _id;
445-
if (request.index() != null)
446-
propsSet |= _index;
443+
propsSet |= _id;
444+
propsSet |= _index;
447445
if (request.type() != null)
448446
propsSet |= _type;
449447

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/DeleteByQueryRequest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,8 +1285,7 @@ protected static void setupDeleteByQueryRequestDeserializer(
12851285

12861286
int propsSet = 0;
12871287

1288-
if (request.index() != null)
1289-
propsSet |= _index;
1288+
propsSet |= _index;
12901289

12911290
if (propsSet == (_index)) {
12921291
StringBuilder buf = new StringBuilder();

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/DeleteByQueryRethrottleRequest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ public DeleteByQueryRethrottleRequest build() {
138138

139139
int propsSet = 0;
140140

141-
if (request.taskId() != null)
142-
propsSet |= _taskId;
141+
propsSet |= _taskId;
143142

144143
if (propsSet == (_taskId)) {
145144
StringBuilder buf = new StringBuilder();

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/DeleteRequest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,8 @@ public DeleteRequest build() {
399399

400400
int propsSet = 0;
401401

402-
if (request.id() != null)
403-
propsSet |= _id;
404-
if (request.index() != null)
405-
propsSet |= _index;
402+
propsSet |= _id;
403+
propsSet |= _index;
406404
if (request.type() != null)
407405
propsSet |= _type;
408406

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/DeleteScriptRequest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ public DeleteScriptRequest build() {
162162

163163
int propsSet = 0;
164164

165-
if (request.id() != null)
166-
propsSet |= _id;
165+
propsSet |= _id;
167166

168167
if (propsSet == (_id)) {
169168
StringBuilder buf = new StringBuilder();

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/ExistsRequest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,8 @@ public ExistsRequest build() {
479479

480480
int propsSet = 0;
481481

482-
if (request.id() != null)
483-
propsSet |= _id;
484-
if (request.index() != null)
485-
propsSet |= _index;
482+
propsSet |= _id;
483+
propsSet |= _index;
486484

487485
if (propsSet == (_index | _id)) {
488486
StringBuilder buf = new StringBuilder();

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/ExistsSourceRequest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,8 @@ public ExistsSourceRequest build() {
459459

460460
int propsSet = 0;
461461

462-
if (request.id() != null)
463-
propsSet |= _id;
464-
if (request.index() != null)
465-
propsSet |= _index;
462+
propsSet |= _id;
463+
propsSet |= _index;
466464
if (request.type() != null)
467465
propsSet |= _type;
468466

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/ExplainRequest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,10 +604,8 @@ protected static void setupExplainRequestDeserializer(DelegatingDeserializer<Exp
604604

605605
int propsSet = 0;
606606

607-
if (request.id() != null)
608-
propsSet |= _id;
609-
if (request.index() != null)
610-
propsSet |= _index;
607+
propsSet |= _id;
608+
propsSet |= _index;
611609

612610
if (propsSet == (_index | _id)) {
613611
StringBuilder buf = new StringBuilder();

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/ExplainResponse.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public final class ExplainResponse<TDocument> implements JsonpSerializable {
5252

5353
private final String id;
5454

55-
private final Boolean matched;
55+
private final boolean matched;
5656

5757
@Nullable
5858
private final ExplanationDetail explanation;
@@ -102,7 +102,7 @@ public String id() {
102102
/**
103103
* API name: {@code matched}
104104
*/
105-
public Boolean matched() {
105+
public boolean matched() {
106106
return this.matched;
107107
}
108108

@@ -215,7 +215,7 @@ public Builder<TDocument> id(String value) {
215215
/**
216216
* API name: {@code matched}
217217
*/
218-
public Builder<TDocument> matched(Boolean value) {
218+
public Builder<TDocument> matched(boolean value) {
219219
this.matched = value;
220220
return this;
221221
}

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/GetRequest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,8 @@ public BuilderT versionType(@Nullable VersionType value) {
492492

493493
int propsSet = 0;
494494

495-
if (request.id() != null)
496-
propsSet |= _id;
497-
if (request.index() != null)
498-
propsSet |= _index;
495+
propsSet |= _id;
496+
propsSet |= _index;
499497

500498
if (propsSet == (_index | _id)) {
501499
StringBuilder buf = new StringBuilder();

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/GetResponse.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public final class GetResponse<TDocument> implements JsonpSerializable {
5353
@Nullable
5454
private final Map<String, JsonData> fields;
5555

56-
private final Boolean found;
56+
private final boolean found;
5757

5858
private final String id;
5959

@@ -114,7 +114,7 @@ public Map<String, JsonData> fields() {
114114
/**
115115
* API name: {@code found}
116116
*/
117-
public Boolean found() {
117+
public boolean found() {
118118
return this.found;
119119
}
120120

@@ -311,7 +311,7 @@ public Builder<TDocument> putFields(String key, JsonData value) {
311311
/**
312312
* API name: {@code found}
313313
*/
314-
public Builder<TDocument> found(Boolean value) {
314+
public Builder<TDocument> found(boolean value) {
315315
this.found = value;
316316
return this;
317317
}

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/GetScriptRequest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ public GetScriptRequest build() {
135135

136136
int propsSet = 0;
137137

138-
if (request.id() != null)
139-
propsSet |= _id;
138+
propsSet |= _id;
140139

141140
if (propsSet == (_id)) {
142141
StringBuilder buf = new StringBuilder();

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/GetScriptResponse.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
public final class GetScriptResponse implements JsonpSerializable {
4545
private final String id;
4646

47-
private final Boolean found;
47+
private final boolean found;
4848

4949
@Nullable
5050
private final StoredScript script;
@@ -69,7 +69,7 @@ public String id() {
6969
/**
7070
* API name: {@code found}
7171
*/
72-
public Boolean found() {
72+
public boolean found() {
7373
return this.found;
7474
}
7575

@@ -131,7 +131,7 @@ public Builder id(String value) {
131131
/**
132132
* API name: {@code found}
133133
*/
134-
public Builder found(Boolean value) {
134+
public Builder found(boolean value) {
135135
this.found = value;
136136
return this;
137137
}

java-client/src/main/java/co/elastic/clients/elasticsearch/_core/IndexRequest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,7 @@ protected static <TDocument> void setupIndexRequestDeserializer(
530530

531531
if (request.id() != null)
532532
propsSet |= _id;
533-
if (request.index() != null)
534-
propsSet |= _index;
533+
propsSet |= _index;
535534

536535
if (propsSet == (_index | _id))
537536
return "PUT";
@@ -550,8 +549,7 @@ protected static <TDocument> void setupIndexRequestDeserializer(
550549

551550
if (request.id() != null)
552551
propsSet |= _id;
553-
if (request.index() != null)
554-
propsSet |= _index;
552+
propsSet |= _index;
555553

556554
if (propsSet == (_index | _id)) {
557555
StringBuilder buf = new StringBuilder();

0 commit comments

Comments
 (0)