diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2c969bd9f8..48028906d1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ This section is for maintaining a changelog for all breaking changes for the cli
### Added
- Document HTTP/2 support ([#330](https://github.com/opensearch-project/opensearch-java/pull/330))
+- Added `toBuilder()` and `Builder.copy()` methods to all generated classes ([#1300](https://github.com/opensearch-project/opensearch-java/pull/1300))
### Dependencies
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java
index ceb941a151..a10d8d9293 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java
@@ -38,6 +38,7 @@
import jakarta.json.stream.JsonGenerator;
import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectDeserializer;
@@ -88,18 +89,31 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
protected abstract static class AbstractBuilder> extends ObjectBuilderBase {
private Boolean acknowledged;
+ protected AbstractBuilder() {}
+
+ protected AbstractBuilder(AcknowledgedResponseBase o) {
+ this.acknowledged = o.acknowledged;
+ }
+
+ protected AbstractBuilder(AbstractBuilder o) {
+ this.acknowledged = o.acknowledged;
+ }
+
+ @Nonnull
+ protected abstract BuilderT self();
+
/**
* Required - For a successful response, this value is always true. On failure, an exception is returned instead.
*
* API name: {@code acknowledged}
*
*/
+ @Nonnull
public final BuilderT acknowledged(boolean value) {
this.acknowledged = value;
return self();
}
- protected abstract BuilderT self();
}
// ---------------------------------------------------------------------------------------------
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java
index ef07e83910..7844ae7e27 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java
@@ -196,6 +196,29 @@ protected abstract static class AbstractBuilder o) {
+ this.attributes = _mapCopy(o.attributes);
+ this.host = o.host;
+ this.ip = o.ip;
+ this.name = o.name;
+ this.roles = _listCopy(o.roles);
+ this.transportAddress = o.transportAddress;
+ }
+
+ @Nonnull
+ protected abstract BuilderT self();
+
/**
* API name: {@code attributes}
*
@@ -203,6 +226,7 @@ protected abstract static class AbstractBuildermap to attributes
.
*
*/
+ @Nonnull
public final BuilderT attributes(Map map) {
this.attributes = _mapPutAll(this.attributes, map);
return self();
@@ -215,6 +239,7 @@ public final BuilderT attributes(Map map) {
* Adds an entry to attributes
.
*
*/
+ @Nonnull
public final BuilderT attributes(String key, String value) {
this.attributes = _mapPut(this.attributes, key, value);
return self();
@@ -223,6 +248,7 @@ public final BuilderT attributes(String key, String value) {
/**
* API name: {@code host}
*/
+ @Nonnull
public final BuilderT host(@Nullable String value) {
this.host = value;
return self();
@@ -231,6 +257,7 @@ public final BuilderT host(@Nullable String value) {
/**
* API name: {@code ip}
*/
+ @Nonnull
public final BuilderT ip(@Nullable String value) {
this.ip = value;
return self();
@@ -239,6 +266,7 @@ public final BuilderT ip(@Nullable String value) {
/**
* Required - API name: {@code name}
*/
+ @Nonnull
public final BuilderT name(String value) {
this.name = value;
return self();
@@ -251,6 +279,7 @@ public final BuilderT name(String value) {
* Adds all elements of list
to roles
.
*
*/
+ @Nonnull
public final BuilderT roles(List list) {
this.roles = _listAddAll(this.roles, list);
return self();
@@ -263,6 +292,7 @@ public final BuilderT roles(List list) {
* Adds one or more values to roles
.
*
*/
+ @Nonnull
public final BuilderT roles(NodeRole value, NodeRole... values) {
this.roles = _listAdd(this.roles, value, values);
return self();
@@ -271,12 +301,12 @@ public final BuilderT roles(NodeRole value, NodeRole... values) {
/**
* API name: {@code transport_address}
*/
+ @Nonnull
public final BuilderT transportAddress(@Nullable String value) {
this.transportAddress = value;
return self();
}
- protected abstract BuilderT self();
}
// ---------------------------------------------------------------------------------------------
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java
index 66578fe695..c141f29b0b 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java
@@ -40,6 +40,7 @@
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
@@ -48,14 +49,16 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.BulkByScrollFailure
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class BulkByScrollFailure implements PlainJsonSerializable {
+public class BulkByScrollFailure implements PlainJsonSerializable, ToCopyableBuilder {
@Nullable
private final ErrorCause cause;
@@ -195,10 +198,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link BulkByScrollFailure}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
@Nullable
private ErrorCause cause;
@Nullable
@@ -213,9 +227,38 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder> fn) {
return cause(fn.apply(new ErrorCause.Builder()).build());
}
@@ -231,6 +275,7 @@ public final Builder cause(Function> fn) {
return reason(fn.apply(new ErrorCause.Builder()).build());
}
@@ -270,6 +319,7 @@ public final Builder reason(Function {
private final int batches;
@@ -348,10 +353,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link BulkByScrollTaskStatus}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private Integer batches;
@Nullable
private String canceled;
@@ -376,12 +392,59 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder
* API name: {@code batches}
*
*/
+ @Nonnull
public final Builder batches(int value) {
this.batches = value;
return this;
@@ -390,6 +453,7 @@ public final Builder batches(int value) {
/**
* API name: {@code canceled}
*/
+ @Nonnull
public final Builder canceled(@Nullable String value) {
this.canceled = value;
return this;
@@ -401,6 +465,7 @@ public final Builder canceled(@Nullable String value) {
* API name: {@code created}
*
*/
+ @Nonnull
public final Builder created(@Nullable Long value) {
this.created = value;
return this;
@@ -412,6 +477,7 @@ public final Builder created(@Nullable Long value) {
* API name: {@code deleted}
*
*/
+ @Nonnull
public final Builder deleted(long value) {
this.deleted = value;
return this;
@@ -423,6 +489,7 @@ public final Builder deleted(long value) {
* API name: {@code noops}
*
*/
+ @Nonnull
public final Builder noops(long value) {
this.noops = value;
return this;
@@ -434,6 +501,7 @@ public final Builder noops(long value) {
* API name: {@code requests_per_second}
*
*/
+ @Nonnull
public final Builder requestsPerSecond(float value) {
this.requestsPerSecond = value;
return this;
@@ -442,6 +510,7 @@ public final Builder requestsPerSecond(float value) {
/**
* Required - API name: {@code retries}
*/
+ @Nonnull
public final Builder retries(Retries value) {
this.retries = value;
return this;
@@ -450,6 +519,7 @@ public final Builder retries(Retries value) {
/**
* Required - API name: {@code retries}
*/
+ @Nonnull
public final Builder retries(Function> fn) {
return retries(fn.apply(new Retries.Builder()).build());
}
@@ -457,6 +527,7 @@ public final Builder retries(Function> f
/**
* API name: {@code slice_id}
*/
+ @Nonnull
public final Builder sliceId(@Nullable Integer value) {
this.sliceId = value;
return this;
@@ -469,6 +540,7 @@ public final Builder sliceId(@Nullable Integer value) {
* Adds all elements of list
to slices
.
*
*/
+ @Nonnull
public final Builder slices(List list) {
this.slices = _listAddAll(this.slices, list);
return this;
@@ -481,6 +553,7 @@ public final Builder slices(List list) {
* Adds one or more values to slices
.
*
*/
+ @Nonnull
public final Builder slices(BulkByScrollTaskStatusOrException value, BulkByScrollTaskStatusOrException... values) {
this.slices = _listAdd(this.slices, value, values);
return this;
@@ -493,6 +566,7 @@ public final Builder slices(BulkByScrollTaskStatusOrException value, BulkByScrol
* Adds a value to slices
using a builder lambda.
*
*/
+ @Nonnull
public final Builder slices(
Function> fn
) {
@@ -502,6 +576,7 @@ public final Builder slices(
/**
* API name: {@code throttled}
*/
+ @Nonnull
public final Builder throttled(@Nullable Time value) {
this.throttled = value;
return this;
@@ -510,6 +585,7 @@ public final Builder throttled(@Nullable Time value) {
/**
* API name: {@code throttled}
*/
+ @Nonnull
public final Builder throttled(Function> fn) {
return throttled(fn.apply(new Time.Builder()).build());
}
@@ -517,6 +593,7 @@ public final Builder throttled(Function> fn) {
/**
* Required - API name: {@code throttled_millis}
*/
+ @Nonnull
public final Builder throttledMillis(long value) {
this.throttledMillis = value;
return this;
@@ -525,6 +602,7 @@ public final Builder throttledMillis(long value) {
/**
* API name: {@code throttled_until}
*/
+ @Nonnull
public final Builder throttledUntil(@Nullable Time value) {
this.throttledUntil = value;
return this;
@@ -533,6 +611,7 @@ public final Builder throttledUntil(@Nullable Time value) {
/**
* API name: {@code throttled_until}
*/
+ @Nonnull
public final Builder throttledUntil(Function> fn) {
return throttledUntil(fn.apply(new Time.Builder()).build());
}
@@ -540,6 +619,7 @@ public final Builder throttledUntil(Function>
/**
* Required - API name: {@code throttled_until_millis}
*/
+ @Nonnull
public final Builder throttledUntilMillis(long value) {
this.throttledUntilMillis = value;
return this;
@@ -551,6 +631,7 @@ public final Builder throttledUntilMillis(long value) {
* API name: {@code total}
*
*/
+ @Nonnull
public final Builder total(long value) {
this.total = value;
return this;
@@ -562,6 +643,7 @@ public final Builder total(long value) {
* API name: {@code updated}
*
*/
+ @Nonnull
public final Builder updated(@Nullable Long value) {
this.updated = value;
return this;
@@ -573,6 +655,7 @@ public final Builder updated(@Nullable Long value) {
* API name: {@code version_conflicts}
*
*/
+ @Nonnull
public final Builder versionConflicts(long value) {
this.versionConflicts = value;
return this;
@@ -583,6 +666,8 @@ public final Builder versionConflicts(long value) {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public BulkByScrollTaskStatus build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java
index 912a69c5c9..cf7142a23d 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java
@@ -53,14 +53,16 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.ErrorCause
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class ErrorCause implements PlainJsonSerializable {
+public class ErrorCause implements PlainJsonSerializable, ToCopyableBuilder {
@Nullable
private final ErrorCause causedBy;
@@ -218,10 +220,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link ErrorCause}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
@Nullable
private ErrorCause causedBy;
@Nullable
@@ -236,9 +249,38 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder metadata;
+ public Builder() {}
+
+ private Builder(ErrorCause o) {
+ this.causedBy = o.causedBy;
+ this.reason = o.reason;
+ this.rootCause = _listCopy(o.rootCause);
+ this.stackTrace = o.stackTrace;
+ this.suppressed = _listCopy(o.suppressed);
+ this.type = o.type;
+ this.metadata = _mapCopy(o.metadata);
+ }
+
+ private Builder(Builder o) {
+ this.causedBy = o.causedBy;
+ this.reason = o.reason;
+ this.rootCause = _listCopy(o.rootCause);
+ this.stackTrace = o.stackTrace;
+ this.suppressed = _listCopy(o.suppressed);
+ this.type = o.type;
+ this.metadata = _mapCopy(o.metadata);
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
* API name: {@code caused_by}
*/
+ @Nonnull
public final Builder causedBy(@Nullable ErrorCause value) {
this.causedBy = value;
return this;
@@ -247,6 +289,7 @@ public final Builder causedBy(@Nullable ErrorCause value) {
/**
* API name: {@code caused_by}
*/
+ @Nonnull
public final Builder causedBy(Function> fn) {
return causedBy(fn.apply(new ErrorCause.Builder()).build());
}
@@ -257,6 +300,7 @@ public final Builder causedBy(Function
*/
+ @Nonnull
public final Builder reason(@Nullable String value) {
this.reason = value;
return this;
@@ -269,6 +313,7 @@ public final Builder reason(@Nullable String value) {
* Adds all elements of list
to rootCause
.
*
*/
+ @Nonnull
public final Builder rootCause(List list) {
this.rootCause = _listAddAll(this.rootCause, list);
return this;
@@ -281,6 +326,7 @@ public final Builder rootCause(List list) {
* Adds one or more values to rootCause
.
*
*/
+ @Nonnull
public final Builder rootCause(ErrorCause value, ErrorCause... values) {
this.rootCause = _listAdd(this.rootCause, value, values);
return this;
@@ -293,6 +339,7 @@ public final Builder rootCause(ErrorCause value, ErrorCause... values) {
* Adds a value to rootCause
using a builder lambda.
*
*/
+ @Nonnull
public final Builder rootCause(Function> fn) {
return rootCause(fn.apply(new ErrorCause.Builder()).build());
}
@@ -303,6 +350,7 @@ public final Builder rootCause(Function
*/
+ @Nonnull
public final Builder stackTrace(@Nullable String value) {
this.stackTrace = value;
return this;
@@ -315,6 +363,7 @@ public final Builder stackTrace(@Nullable String value) {
* Adds all elements of list
to suppressed
.
*
*/
+ @Nonnull
public final Builder suppressed(List list) {
this.suppressed = _listAddAll(this.suppressed, list);
return this;
@@ -327,6 +376,7 @@ public final Builder suppressed(List list) {
* Adds one or more values to suppressed
.
*
*/
+ @Nonnull
public final Builder suppressed(ErrorCause value, ErrorCause... values) {
this.suppressed = _listAdd(this.suppressed, value, values);
return this;
@@ -339,6 +389,7 @@ public final Builder suppressed(ErrorCause value, ErrorCause... values) {
* Adds a value to suppressed
using a builder lambda.
*
*/
+ @Nonnull
public final Builder suppressed(Function> fn) {
return suppressed(fn.apply(new ErrorCause.Builder()).build());
}
@@ -349,6 +400,7 @@ public final Builder suppressed(Function
*/
+ @Nonnull
public final Builder type(String value) {
this.type = value;
return this;
@@ -361,6 +413,7 @@ public final Builder type(String value) {
* Adds all elements of map
to metadata
.
*
*/
+ @Nonnull
public final Builder metadata(Map map) {
this.metadata = _mapPutAll(this.metadata, map);
return this;
@@ -373,6 +426,7 @@ public final Builder metadata(Map map) {
* Adds an entry to metadata
.
*
*/
+ @Nonnull
public final Builder metadata(String key, JsonData value) {
this.metadata = _mapPut(this.metadata, key, value);
return this;
@@ -383,6 +437,8 @@ public final Builder metadata(String key, JsonData value) {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public ErrorCause build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoHashLocation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoHashLocation.java
index f37286c733..1f22b2f1ee 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoHashLocation.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoHashLocation.java
@@ -47,14 +47,16 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.GeoHashLocation
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class GeoHashLocation implements PlainJsonSerializable {
+public class GeoHashLocation implements PlainJsonSerializable, ToCopyableBuilder {
@Nonnull
private final String geohash;
@@ -94,15 +96,43 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link GeoHashLocation}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private String geohash;
+ public Builder() {}
+
+ private Builder(GeoHashLocation o) {
+ this.geohash = o.geohash;
+ }
+
+ private Builder(Builder o) {
+ this.geohash = o.geohash;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
* Required - API name: {@code geohash}
*/
+ @Nonnull
public final Builder geohash(String value) {
this.geohash = value;
return this;
@@ -113,6 +143,8 @@ public final Builder geohash(String value) {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public GeoHashLocation build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IndicesResponseBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IndicesResponseBase.java
index 3308f0c8b5..4acf5c0423 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IndicesResponseBase.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IndicesResponseBase.java
@@ -40,6 +40,7 @@
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectDeserializer;
@@ -83,9 +84,22 @@ protected abstract static class AbstractBuilder o) {
+ super(o);
+ this.shards = o.shards;
+ }
+
/**
* API name: {@code _shards}
*/
+ @Nonnull
public final BuilderT shards(@Nullable ShardStatistics value) {
this.shards = value;
return self();
@@ -94,6 +108,7 @@ public final BuilderT shards(@Nullable ShardStatistics value) {
/**
* API name: {@code _shards}
*/
+ @Nonnull
public final BuilderT shards(Function> fn) {
return shards(fn.apply(new ShardStatistics.Builder()).build());
}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/InlineScript.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/InlineScript.java
index fd2cde01a6..1ca9006ee2 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/InlineScript.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/InlineScript.java
@@ -49,13 +49,15 @@
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.InlineScript
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class InlineScript extends ScriptBase {
+public class InlineScript extends ScriptBase implements ToCopyableBuilder {
@Nullable
private final ScriptLanguage lang;
@@ -129,19 +131,59 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link InlineScript}.
*/
- public static class Builder extends ScriptBase.AbstractBuilder implements ObjectBuilder {
+ public static class Builder extends ScriptBase.AbstractBuilder implements CopyableBuilder {
@Nullable
private ScriptLanguage lang;
@Nullable
private Map options;
private String source;
+ public Builder() {}
+
+ private Builder(InlineScript o) {
+ super(o);
+ this.lang = o.lang;
+ this.options = _mapCopy(o.options);
+ this.source = o.source;
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.lang = o.lang;
+ this.options = _mapCopy(o.options);
+ this.source = o.source;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* API name: {@code lang}
*/
+ @Nonnull
public final Builder lang(@Nullable ScriptLanguage value) {
this.lang = value;
return this;
@@ -150,6 +192,7 @@ public final Builder lang(@Nullable ScriptLanguage value) {
/**
* API name: {@code lang}
*/
+ @Nonnull
public final Builder lang(Function> fn) {
return lang(fn.apply(new ScriptLanguage.Builder()).build());
}
@@ -161,6 +204,7 @@ public final Builder lang(Functionmap to options
.
*
*/
+ @Nonnull
public final Builder options(Map map) {
this.options = _mapPutAll(this.options, map);
return this;
@@ -173,6 +217,7 @@ public final Builder options(Map map) {
* Adds an entry to options
.
*
*/
+ @Nonnull
public final Builder options(String key, String value) {
this.options = _mapPut(this.options, key, value);
return this;
@@ -184,21 +229,19 @@ public final Builder options(String key, String value) {
* API name: {@code source}
*
*/
+ @Nonnull
public final Builder source(String value) {
this.source = value;
return this;
}
- @Override
- protected Builder self() {
- return this;
- }
-
/**
* Builds a {@link InlineScript}.
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public InlineScript build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/LatLonGeoLocation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/LatLonGeoLocation.java
index bfbe518695..4c9a0fcebe 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/LatLonGeoLocation.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/LatLonGeoLocation.java
@@ -39,6 +39,7 @@
import jakarta.json.stream.JsonGenerator;
import java.util.function.Function;
import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
@@ -46,14 +47,16 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.LatLonGeoLocation
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class LatLonGeoLocation implements PlainJsonSerializable {
+public class LatLonGeoLocation implements PlainJsonSerializable, ToCopyableBuilder {
private final double lat;
@@ -110,19 +113,49 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link LatLonGeoLocation}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private Double lat;
private Double lon;
+ public Builder() {}
+
+ private Builder(LatLonGeoLocation o) {
+ this.lat = o.lat;
+ this.lon = o.lon;
+ }
+
+ private Builder(Builder o) {
+ this.lat = o.lat;
+ this.lon = o.lon;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
* Required - Latitude
*
* API name: {@code lat}
*
*/
+ @Nonnull
public final Builder lat(double value) {
this.lat = value;
return this;
@@ -134,6 +167,7 @@ public final Builder lat(double value) {
* API name: {@code lon}
*
*/
+ @Nonnull
public final Builder lon(double value) {
this.lon = value;
return this;
@@ -144,6 +178,8 @@ public final Builder lon(double value) {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public LatLonGeoLocation build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeStatistics.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeStatistics.java
index ae9635e172..6e19be6b1b 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeStatistics.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeStatistics.java
@@ -50,14 +50,16 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.NodeStatistics
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class NodeStatistics implements PlainJsonSerializable {
+public class NodeStatistics implements PlainJsonSerializable, ToCopyableBuilder {
private final int failed;
@@ -152,16 +154,49 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link NodeStatistics}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private Integer failed;
@Nullable
private List failures;
private Integer successful;
private Integer total;
+ public Builder() {}
+
+ private Builder(NodeStatistics o) {
+ this.failed = o.failed;
+ this.failures = _listCopy(o.failures);
+ this.successful = o.successful;
+ this.total = o.total;
+ }
+
+ private Builder(Builder o) {
+ this.failed = o.failed;
+ this.failures = _listCopy(o.failures);
+ this.successful = o.successful;
+ this.total = o.total;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
* Required - The number of nodes that rejected the request or failed to respond. If this value is not 0, then a reason for the
* rejection or failure is included in the response.
@@ -169,6 +204,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder
*/
+ @Nonnull
public final Builder failed(int value) {
this.failed = value;
return this;
@@ -181,6 +217,7 @@ public final Builder failed(int value) {
* Adds all elements of list
to failures
.
*
*/
+ @Nonnull
public final Builder failures(List list) {
this.failures = _listAddAll(this.failures, list);
return this;
@@ -193,6 +230,7 @@ public final Builder failures(List list) {
* Adds one or more values to failures
.
*
*/
+ @Nonnull
public final Builder failures(ErrorCause value, ErrorCause... values) {
this.failures = _listAdd(this.failures, value, values);
return this;
@@ -205,6 +243,7 @@ public final Builder failures(ErrorCause value, ErrorCause... values) {
* Adds a value to failures
using a builder lambda.
*
*/
+ @Nonnull
public final Builder failures(Function> fn) {
return failures(fn.apply(new ErrorCause.Builder()).build());
}
@@ -215,6 +254,7 @@ public final Builder failures(Function
*/
+ @Nonnull
public final Builder successful(int value) {
this.successful = value;
return this;
@@ -226,6 +266,7 @@ public final Builder successful(int value) {
* API name: {@code total}
*
*/
+ @Nonnull
public final Builder total(int value) {
this.total = value;
return this;
@@ -236,6 +277,8 @@ public final Builder total(int value) {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public NodeStatistics build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/OpenSearchVersionInfo.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/OpenSearchVersionInfo.java
index b6fcfb9eab..964254af0c 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/OpenSearchVersionInfo.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/OpenSearchVersionInfo.java
@@ -49,14 +49,19 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.OpenSearchVersionInfo
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class OpenSearchVersionInfo implements PlainJsonSerializable {
+public class OpenSearchVersionInfo
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder {
@Nonnull
private final String buildDate;
@@ -239,10 +244,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link OpenSearchVersionInfo}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private String buildDate;
@Nullable
private String buildFlavor;
@@ -255,9 +271,44 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
private final long bulk;
@@ -104,16 +107,46 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link Retries}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private Long bulk;
private Long search;
+ public Builder() {}
+
+ private Builder(Retries o) {
+ this.bulk = o.bulk;
+ this.search = o.search;
+ }
+
+ private Builder(Builder o) {
+ this.bulk = o.bulk;
+ this.search = o.search;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
* Required - API name: {@code bulk}
*/
+ @Nonnull
public final Builder bulk(long value) {
this.bulk = value;
return this;
@@ -122,6 +155,7 @@ public final Builder bulk(long value) {
/**
* Required - API name: {@code search}
*/
+ @Nonnull
public final Builder search(long value) {
this.search = value;
return this;
@@ -132,6 +166,8 @@ public final Builder search(long value) {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public Retries build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ScriptBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ScriptBase.java
index 787f086689..1178b7dc27 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ScriptBase.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ScriptBase.java
@@ -104,6 +104,19 @@ protected abstract static class AbstractBuilder params;
+ protected AbstractBuilder() {}
+
+ protected AbstractBuilder(ScriptBase o) {
+ this.params = _mapCopy(o.params);
+ }
+
+ protected AbstractBuilder(AbstractBuilder o) {
+ this.params = _mapCopy(o.params);
+ }
+
+ @Nonnull
+ protected abstract BuilderT self();
+
/**
* Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to
* decrease compilation time.
@@ -115,6 +128,7 @@ protected abstract static class AbstractBuildermap to params
.
*
*/
+ @Nonnull
public final BuilderT params(Map map) {
this.params = _mapPutAll(this.params, map);
return self();
@@ -131,12 +145,12 @@ public final BuilderT params(Map map) {
* Adds an entry to params
.
*
*/
+ @Nonnull
public final BuilderT params(String key, JsonData value) {
this.params = _mapPut(this.params, key, value);
return self();
}
- protected abstract BuilderT self();
}
// ---------------------------------------------------------------------------------------------
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardFailure.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardFailure.java
index eecec2fe8c..c8dd0863ec 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardFailure.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardFailure.java
@@ -49,14 +49,16 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.ShardFailure
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class ShardFailure implements PlainJsonSerializable {
+public class ShardFailure implements PlainJsonSerializable, ToCopyableBuilder {
@Nullable
private final String index;
@@ -160,10 +162,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link ShardFailure}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
@Nullable
private String index;
@Nullable
@@ -173,9 +186,34 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder> fn) {
return reason(fn.apply(new ErrorCause.Builder()).build());
}
@@ -207,6 +248,7 @@ public final Builder reason(Function {
private final int failed;
@@ -159,10 +161,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link ShardStatistics}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private Integer failed;
@Nullable
private List failures;
@@ -171,9 +184,34 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to failures
.
*
*/
+ @Nonnull
public final Builder failures(List list) {
this.failures = _listAddAll(this.failures, list);
return this;
@@ -198,6 +237,7 @@ public final Builder failures(List list) {
* Adds one or more values to failures
.
*
*/
+ @Nonnull
public final Builder failures(ShardFailure value, ShardFailure... values) {
this.failures = _listAdd(this.failures, value, values);
return this;
@@ -210,6 +250,7 @@ public final Builder failures(ShardFailure value, ShardFailure... values) {
* Adds a value to failures
using a builder lambda.
*
*/
+ @Nonnull
public final Builder failures(Function> fn) {
return failures(fn.apply(new ShardFailure.Builder()).build());
}
@@ -217,6 +258,7 @@ public final Builder failures(Function {
@Nonnull
private final String id;
@@ -84,30 +86,63 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link StoredScriptId}.
*/
- public static class Builder extends ScriptBase.AbstractBuilder implements ObjectBuilder {
+ public static class Builder extends ScriptBase.AbstractBuilder implements CopyableBuilder {
private String id;
+ public Builder() {}
+
+ private Builder(StoredScriptId o) {
+ super(o);
+ this.id = o.id;
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.id = o.id;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* Required - API name: {@code id}
*/
+ @Nonnull
public final Builder id(String value) {
this.id = value;
return this;
}
- @Override
- protected Builder self() {
- return this;
- }
-
/**
* Builds a {@link StoredScriptId}.
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public StoredScriptId build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TaskFailure.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TaskFailure.java
index 73be11b4d2..558f1462b9 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TaskFailure.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TaskFailure.java
@@ -47,14 +47,16 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.TaskFailure
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class TaskFailure implements PlainJsonSerializable {
+public class TaskFailure implements PlainJsonSerializable, ToCopyableBuilder {
@Nonnull
private final String nodeId;
@@ -137,18 +139,52 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link TaskFailure}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private String nodeId;
private ErrorCause reason;
private String status;
private Integer taskId;
+ public Builder() {}
+
+ private Builder(TaskFailure o) {
+ this.nodeId = o.nodeId;
+ this.reason = o.reason;
+ this.status = o.status;
+ this.taskId = o.taskId;
+ }
+
+ private Builder(Builder o) {
+ this.nodeId = o.nodeId;
+ this.reason = o.reason;
+ this.status = o.status;
+ this.taskId = o.taskId;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
* Required - API name: {@code node_id}
*/
+ @Nonnull
public final Builder nodeId(String value) {
this.nodeId = value;
return this;
@@ -157,6 +193,7 @@ public final Builder nodeId(String value) {
/**
* Required - API name: {@code reason}
*/
+ @Nonnull
public final Builder reason(ErrorCause value) {
this.reason = value;
return this;
@@ -165,6 +202,7 @@ public final Builder reason(ErrorCause value) {
/**
* Required - API name: {@code reason}
*/
+ @Nonnull
public final Builder reason(Function> fn) {
return reason(fn.apply(new ErrorCause.Builder()).build());
}
@@ -172,6 +210,7 @@ public final Builder reason(Function o) {
+ this.forcedRefresh = o.forcedRefresh;
+ this.id = o.id;
+ this.index = o.index;
+ this.primaryTerm = o.primaryTerm;
+ this.result = o.result;
+ this.seqNo = o.seqNo;
+ this.shards = o.shards;
+ this.version = o.version;
+ }
+
+ @Nonnull
+ protected abstract BuilderT self();
+
/**
* API name: {@code forced_refresh}
*/
+ @Nonnull
public final BuilderT forcedRefresh(@Nullable Boolean value) {
this.forcedRefresh = value;
return self();
@@ -212,6 +240,7 @@ public final BuilderT forcedRefresh(@Nullable Boolean value) {
/**
* Required - API name: {@code _id}
*/
+ @Nonnull
public final BuilderT id(String value) {
this.id = value;
return self();
@@ -220,6 +249,7 @@ public final BuilderT id(String value) {
/**
* Required - API name: {@code _index}
*/
+ @Nonnull
public final BuilderT index(String value) {
this.index = value;
return self();
@@ -228,6 +258,7 @@ public final BuilderT index(String value) {
/**
* Required - API name: {@code _primary_term}
*/
+ @Nonnull
public final BuilderT primaryTerm(long value) {
this.primaryTerm = value;
return self();
@@ -236,6 +267,7 @@ public final BuilderT primaryTerm(long value) {
/**
* Required - API name: {@code result}
*/
+ @Nonnull
public final BuilderT result(Result value) {
this.result = value;
return self();
@@ -244,6 +276,7 @@ public final BuilderT result(Result value) {
/**
* Required - API name: {@code _seq_no}
*/
+ @Nonnull
public final BuilderT seqNo(long value) {
this.seqNo = value;
return self();
@@ -252,6 +285,7 @@ public final BuilderT seqNo(long value) {
/**
* Required - API name: {@code _shards}
*/
+ @Nonnull
public final BuilderT shards(ShardStatistics value) {
this.shards = value;
return self();
@@ -260,6 +294,7 @@ public final BuilderT shards(ShardStatistics value) {
/**
* Required - API name: {@code _shards}
*/
+ @Nonnull
public final BuilderT shards(Function> fn) {
return shards(fn.apply(new ShardStatistics.Builder()).build());
}
@@ -267,12 +302,12 @@ public final BuilderT shards(Function {
private final double x;
@@ -86,19 +92,49 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link XyCartesianCoordinates}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private Double x;
private Double y;
+ public Builder() {}
+
+ private Builder(XyCartesianCoordinates o) {
+ this.x = o.x;
+ this.y = o.y;
+ }
+
+ private Builder(Builder o) {
+ this.x = o.x;
+ this.y = o.y;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
* Required - The x coordinate.
*
* API name: {@code x}
*
*/
+ @Nonnull
public final Builder x(double value) {
this.x = value;
return this;
@@ -110,6 +146,7 @@ public final Builder x(double value) {
* API name: {@code y}
*
*/
+ @Nonnull
public final Builder y(double value) {
this.y = value;
return this;
@@ -120,6 +157,8 @@ public final Builder y(double value) {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public XyCartesianCoordinates build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/AsciiFoldingTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/AsciiFoldingTokenFilter.java
index 66e859ba78..66c9f8a4e6 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/AsciiFoldingTokenFilter.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/AsciiFoldingTokenFilter.java
@@ -40,19 +40,25 @@
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.AsciiFoldingTokenFilter
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class AsciiFoldingTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant {
+public class AsciiFoldingTokenFilter extends TokenFilterBase
+ implements
+ TokenFilterDefinitionVariant,
+ ToCopyableBuilder {
@Nullable
private final Boolean preserveOriginal;
@@ -95,31 +101,66 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link AsciiFoldingTokenFilter}.
*/
- public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder {
+ public static class Builder extends TokenFilterBase.AbstractBuilder
+ implements
+ CopyableBuilder {
@Nullable
private Boolean preserveOriginal;
+ public Builder() {}
+
+ private Builder(AsciiFoldingTokenFilter o) {
+ super(o);
+ this.preserveOriginal = o.preserveOriginal;
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.preserveOriginal = o.preserveOriginal;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* API name: {@code preserve_original}
*/
+ @Nonnull
public final Builder preserveOriginal(@Nullable Boolean value) {
this.preserveOriginal = value;
return this;
}
- @Override
- protected Builder self() {
- return this;
- }
-
/**
* Builds a {@link AsciiFoldingTokenFilter}.
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public AsciiFoldingTokenFilter build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharFilterBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharFilterBase.java
index 1bea5b8ef0..c95f2d51b8 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharFilterBase.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharFilterBase.java
@@ -39,6 +39,7 @@
import jakarta.json.stream.JsonGenerator;
import java.util.Objects;
import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
@@ -91,15 +92,28 @@ protected abstract static class AbstractBuilder o) {
+ this.version = o.version;
+ }
+
+ @Nonnull
+ protected abstract BuilderT self();
+
/**
* API name: {@code version}
*/
+ @Nonnull
public final BuilderT version(@Nullable String value) {
this.version = value;
return self();
}
- protected abstract BuilderT self();
}
// ---------------------------------------------------------------------------------------------
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharGroupTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharGroupTokenizer.java
index 7395b6c383..b3436e47d3 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharGroupTokenizer.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharGroupTokenizer.java
@@ -49,13 +49,18 @@
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.CharGroupTokenizer
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class CharGroupTokenizer extends TokenizerBase implements TokenizerDefinitionVariant {
+public class CharGroupTokenizer extends TokenizerBase
+ implements
+ TokenizerDefinitionVariant,
+ ToCopyableBuilder {
@Nullable
private final Integer maxTokenLength;
@@ -117,17 +122,55 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link CharGroupTokenizer}.
*/
- public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder {
+ public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder {
@Nullable
private Integer maxTokenLength;
private List tokenizeOnChars;
+ public Builder() {}
+
+ private Builder(CharGroupTokenizer o) {
+ super(o);
+ this.maxTokenLength = o.maxTokenLength;
+ this.tokenizeOnChars = _listCopy(o.tokenizeOnChars);
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.maxTokenLength = o.maxTokenLength;
+ this.tokenizeOnChars = _listCopy(o.tokenizeOnChars);
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* API name: {@code max_token_length}
*/
+ @Nonnull
public final Builder maxTokenLength(@Nullable Integer value) {
this.maxTokenLength = value;
return this;
@@ -140,6 +183,7 @@ public final Builder maxTokenLength(@Nullable Integer value) {
* Adds all elements of list
to tokenizeOnChars
.
*
*/
+ @Nonnull
public final Builder tokenizeOnChars(List list) {
this.tokenizeOnChars = _listAddAll(this.tokenizeOnChars, list);
return this;
@@ -152,21 +196,19 @@ public final Builder tokenizeOnChars(List list) {
* Adds one or more values to tokenizeOnChars
.
*
*/
+ @Nonnull
public final Builder tokenizeOnChars(String value, String... values) {
this.tokenizeOnChars = _listAdd(this.tokenizeOnChars, value, values);
return this;
}
- @Override
- protected Builder self() {
- return this;
- }
-
/**
* Builds a {@link CharGroupTokenizer}.
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public CharGroupTokenizer build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CjkAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CjkAnalyzer.java
index 2f14edda25..bc930fd262 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CjkAnalyzer.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CjkAnalyzer.java
@@ -26,14 +26,16 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.CjkAnalyzer
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class CjkAnalyzer implements AnalyzerVariant, PlainJsonSerializable {
+public class CjkAnalyzer implements AnalyzerVariant, PlainJsonSerializable, ToCopyableBuilder {
@Nonnull
private final List stopwords;
@@ -105,15 +107,44 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link CjkAnalyzer}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
@Nullable
private List stopwords;
@Nullable
private String stopwordsPath;
+ public Builder() {}
+
+ private Builder(CjkAnalyzer o) {
+ this.stopwords = _listCopy(o.stopwords);
+ this.stopwordsPath = o.stopwordsPath;
+ }
+
+ private Builder(Builder o) {
+ this.stopwords = _listCopy(o.stopwords);
+ this.stopwordsPath = o.stopwordsPath;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
* API name: {@code stopwords}
*
@@ -121,6 +152,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to stopwords
.
*
*/
+ @Nonnull
public final Builder stopwords(List list) {
this.stopwords = _listAddAll(this.stopwords, list);
return this;
@@ -133,6 +165,7 @@ public final Builder stopwords(List list) {
* Adds one or more values to stopwords
.
*
*/
+ @Nonnull
public final Builder stopwords(String value, String... values) {
this.stopwords = _listAdd(this.stopwords, value, values);
return this;
@@ -141,6 +174,7 @@ public final Builder stopwords(String value, String... values) {
/**
* API name: {@code stopwords_path}
*/
+ @Nonnull
public final Builder stopwordsPath(@Nullable String value) {
this.stopwordsPath = value;
return this;
@@ -151,6 +185,8 @@ public final Builder stopwordsPath(@Nullable String value) {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public CjkAnalyzer build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CommonGramsTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CommonGramsTokenFilter.java
index 959f5e873f..8b7302fe2e 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CommonGramsTokenFilter.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CommonGramsTokenFilter.java
@@ -49,13 +49,18 @@
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.CommonGramsTokenFilter
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class CommonGramsTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant {
+public class CommonGramsTokenFilter extends TokenFilterBase
+ implements
+ TokenFilterDefinitionVariant,
+ ToCopyableBuilder {
@Nonnull
private final List commonWords;
@@ -153,10 +158,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link CommonGramsTokenFilter}.
*/
- public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder {
+ public static class Builder extends TokenFilterBase.AbstractBuilder
+ implements
+ CopyableBuilder {
@Nullable
private List commonWords;
@Nullable
@@ -166,6 +184,36 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp
@Nullable
private Boolean queryMode;
+ public Builder() {}
+
+ private Builder(CommonGramsTokenFilter o) {
+ super(o);
+ this.commonWords = _listCopy(o.commonWords);
+ this.commonWordsPath = o.commonWordsPath;
+ this.ignoreCase = o.ignoreCase;
+ this.queryMode = o.queryMode;
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.commonWords = _listCopy(o.commonWords);
+ this.commonWordsPath = o.commonWordsPath;
+ this.ignoreCase = o.ignoreCase;
+ this.queryMode = o.queryMode;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* API name: {@code common_words}
*
@@ -173,6 +221,7 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp
* Adds all elements of list
to commonWords
.
*
*/
+ @Nonnull
public final Builder commonWords(List list) {
this.commonWords = _listAddAll(this.commonWords, list);
return this;
@@ -185,6 +234,7 @@ public final Builder commonWords(List list) {
* Adds one or more values to commonWords
.
*
*/
+ @Nonnull
public final Builder commonWords(String value, String... values) {
this.commonWords = _listAdd(this.commonWords, value, values);
return this;
@@ -193,6 +243,7 @@ public final Builder commonWords(String value, String... values) {
/**
* API name: {@code common_words_path}
*/
+ @Nonnull
public final Builder commonWordsPath(@Nullable String value) {
this.commonWordsPath = value;
return this;
@@ -201,6 +252,7 @@ public final Builder commonWordsPath(@Nullable String value) {
/**
* API name: {@code ignore_case}
*/
+ @Nonnull
public final Builder ignoreCase(@Nullable Boolean value) {
this.ignoreCase = value;
return this;
@@ -209,21 +261,19 @@ public final Builder ignoreCase(@Nullable Boolean value) {
/**
* API name: {@code query_mode}
*/
+ @Nonnull
public final Builder queryMode(@Nullable Boolean value) {
this.queryMode = value;
return this;
}
- @Override
- protected Builder self() {
- return this;
- }
-
/**
* Builds a {@link CommonGramsTokenFilter}.
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public CommonGramsTokenFilter build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CompoundWordTokenFilterBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CompoundWordTokenFilterBase.java
index 1a93cfbb5c..a448247e56 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CompoundWordTokenFilterBase.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CompoundWordTokenFilterBase.java
@@ -203,9 +203,34 @@ protected abstract static class AbstractBuilder o) {
+ super(o);
+ this.hyphenationPatternsPath = o.hyphenationPatternsPath;
+ this.maxSubwordSize = o.maxSubwordSize;
+ this.minSubwordSize = o.minSubwordSize;
+ this.minWordSize = o.minWordSize;
+ this.onlyLongestMatch = o.onlyLongestMatch;
+ this.wordList = _listCopy(o.wordList);
+ this.wordListPath = o.wordListPath;
+ }
+
/**
* API name: {@code hyphenation_patterns_path}
*/
+ @Nonnull
public final BuilderT hyphenationPatternsPath(@Nullable String value) {
this.hyphenationPatternsPath = value;
return self();
@@ -214,6 +239,7 @@ public final BuilderT hyphenationPatternsPath(@Nullable String value) {
/**
* API name: {@code max_subword_size}
*/
+ @Nonnull
public final BuilderT maxSubwordSize(@Nullable Integer value) {
this.maxSubwordSize = value;
return self();
@@ -222,6 +248,7 @@ public final BuilderT maxSubwordSize(@Nullable Integer value) {
/**
* API name: {@code min_subword_size}
*/
+ @Nonnull
public final BuilderT minSubwordSize(@Nullable Integer value) {
this.minSubwordSize = value;
return self();
@@ -230,6 +257,7 @@ public final BuilderT minSubwordSize(@Nullable Integer value) {
/**
* API name: {@code min_word_size}
*/
+ @Nonnull
public final BuilderT minWordSize(@Nullable Integer value) {
this.minWordSize = value;
return self();
@@ -238,6 +266,7 @@ public final BuilderT minWordSize(@Nullable Integer value) {
/**
* API name: {@code only_longest_match}
*/
+ @Nonnull
public final BuilderT onlyLongestMatch(@Nullable Boolean value) {
this.onlyLongestMatch = value;
return self();
@@ -250,6 +279,7 @@ public final BuilderT onlyLongestMatch(@Nullable Boolean value) {
* Adds all elements of list
to wordList
.
*
*/
+ @Nonnull
public final BuilderT wordList(List list) {
this.wordList = _listAddAll(this.wordList, list);
return self();
@@ -262,6 +292,7 @@ public final BuilderT wordList(List list) {
* Adds one or more values to wordList
.
*
*/
+ @Nonnull
public final BuilderT wordList(String value, String... values) {
this.wordList = _listAdd(this.wordList, value, values);
return self();
@@ -270,6 +301,7 @@ public final BuilderT wordList(String value, String... values) {
/**
* API name: {@code word_list_path}
*/
+ @Nonnull
public final BuilderT wordListPath(@Nullable String value) {
this.wordListPath = value;
return self();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ConditionTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ConditionTokenFilter.java
index 32f27f48a3..4350c60b19 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ConditionTokenFilter.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ConditionTokenFilter.java
@@ -48,13 +48,18 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.opensearch._types.Script;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.ConditionTokenFilter
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class ConditionTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant {
+public class ConditionTokenFilter extends TokenFilterBase
+ implements
+ TokenFilterDefinitionVariant,
+ ToCopyableBuilder {
@Nonnull
private final List filter;
@@ -114,13 +119,50 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link ConditionTokenFilter}.
*/
- public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder {
+ public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder {
private List filter;
private Script script;
+ public Builder() {}
+
+ private Builder(ConditionTokenFilter o) {
+ super(o);
+ this.filter = _listCopy(o.filter);
+ this.script = o.script;
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.filter = _listCopy(o.filter);
+ this.script = o.script;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* Required - API name: {@code filter}
*
@@ -128,6 +170,7 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp
* Adds all elements of list
to filter
.
*
*/
+ @Nonnull
public final Builder filter(List list) {
this.filter = _listAddAll(this.filter, list);
return this;
@@ -140,6 +183,7 @@ public final Builder filter(List list) {
* Adds one or more values to filter
.
*
*/
+ @Nonnull
public final Builder filter(String value, String... values) {
this.filter = _listAdd(this.filter, value, values);
return this;
@@ -148,6 +192,7 @@ public final Builder filter(String value, String... values) {
/**
* Required - API name: {@code script}
*/
+ @Nonnull
public final Builder script(Script value) {
this.script = value;
return this;
@@ -156,20 +201,18 @@ public final Builder script(Script value) {
/**
* Required - API name: {@code script}
*/
+ @Nonnull
public final Builder script(Function> fn) {
return script(fn.apply(new Script.Builder()).build());
}
- @Override
- protected Builder self() {
- return this;
- }
-
/**
* Builds a {@link ConditionTokenFilter}.
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public ConditionTokenFilter build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomAnalyzer.java
index be8b2dfc40..f8e2ab0ffc 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomAnalyzer.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomAnalyzer.java
@@ -50,14 +50,16 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.CustomAnalyzer
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class CustomAnalyzer implements AnalyzerVariant, PlainJsonSerializable {
+public class CustomAnalyzer implements AnalyzerVariant, PlainJsonSerializable, ToCopyableBuilder {
@Nonnull
private final List charFilter;
@@ -182,10 +184,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link CustomAnalyzer}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
@Nullable
private List charFilter;
@Nullable
@@ -196,6 +209,30 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to charFilter
.
*
*/
+ @Nonnull
public final Builder charFilter(List list) {
this.charFilter = _listAddAll(this.charFilter, list);
return this;
@@ -215,6 +253,7 @@ public final Builder charFilter(List list) {
* Adds one or more values to charFilter
.
*
*/
+ @Nonnull
public final Builder charFilter(String value, String... values) {
this.charFilter = _listAdd(this.charFilter, value, values);
return this;
@@ -227,6 +266,7 @@ public final Builder charFilter(String value, String... values) {
* Adds all elements of list
to filter
.
*
*/
+ @Nonnull
public final Builder filter(List list) {
this.filter = _listAddAll(this.filter, list);
return this;
@@ -239,6 +279,7 @@ public final Builder filter(List list) {
* Adds one or more values to filter
.
*
*/
+ @Nonnull
public final Builder filter(String value, String... values) {
this.filter = _listAdd(this.filter, value, values);
return this;
@@ -247,6 +288,7 @@ public final Builder filter(String value, String... values) {
/**
* API name: {@code position_increment_gap}
*/
+ @Nonnull
public final Builder positionIncrementGap(@Nullable Integer value) {
this.positionIncrementGap = value;
return this;
@@ -255,6 +297,7 @@ public final Builder positionIncrementGap(@Nullable Integer value) {
/**
* API name: {@code position_offset_gap}
*/
+ @Nonnull
public final Builder positionOffsetGap(@Nullable Integer value) {
this.positionOffsetGap = value;
return this;
@@ -263,6 +306,7 @@ public final Builder positionOffsetGap(@Nullable Integer value) {
/**
* Required - API name: {@code tokenizer}
*/
+ @Nonnull
public final Builder tokenizer(String value) {
this.tokenizer = value;
return this;
@@ -273,6 +317,8 @@ public final Builder tokenizer(String value) {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public CustomAnalyzer build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomNormalizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomNormalizer.java
index 2c5f6eb35f..8dbab6bc34 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomNormalizer.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomNormalizer.java
@@ -50,14 +50,20 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.CustomNormalizer
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class CustomNormalizer implements NormalizerVariant, PlainJsonSerializable {
+public class CustomNormalizer
+ implements
+ NormalizerVariant,
+ PlainJsonSerializable,
+ ToCopyableBuilder {
@Nonnull
private final List charFilter;
@@ -133,15 +139,44 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link CustomNormalizer}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
@Nullable
private List charFilter;
@Nullable
private List filter;
+ public Builder() {}
+
+ private Builder(CustomNormalizer o) {
+ this.charFilter = _listCopy(o.charFilter);
+ this.filter = _listCopy(o.filter);
+ }
+
+ private Builder(Builder o) {
+ this.charFilter = _listCopy(o.charFilter);
+ this.filter = _listCopy(o.filter);
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
* API name: {@code char_filter}
*
@@ -149,6 +184,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to charFilter
.
*
*/
+ @Nonnull
public final Builder charFilter(List list) {
this.charFilter = _listAddAll(this.charFilter, list);
return this;
@@ -161,6 +197,7 @@ public final Builder charFilter(List list) {
* Adds one or more values to charFilter
.
*
*/
+ @Nonnull
public final Builder charFilter(String value, String... values) {
this.charFilter = _listAdd(this.charFilter, value, values);
return this;
@@ -173,6 +210,7 @@ public final Builder charFilter(String value, String... values) {
* Adds all elements of list
to filter
.
*
*/
+ @Nonnull
public final Builder filter(List list) {
this.filter = _listAddAll(this.filter, list);
return this;
@@ -185,6 +223,7 @@ public final Builder filter(List list) {
* Adds one or more values to filter
.
*
*/
+ @Nonnull
public final Builder filter(String value, String... values) {
this.filter = _listAdd(this.filter, value, values);
return this;
@@ -195,6 +234,8 @@ public final Builder filter(String value, String... values) {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public CustomNormalizer build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DelimitedPayloadTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DelimitedPayloadTokenFilter.java
index 6528fb0fbb..316f39f822 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DelimitedPayloadTokenFilter.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DelimitedPayloadTokenFilter.java
@@ -40,19 +40,25 @@
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.DelimitedPayloadTokenFilter
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class DelimitedPayloadTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant {
+public class DelimitedPayloadTokenFilter extends TokenFilterBase
+ implements
+ TokenFilterDefinitionVariant,
+ ToCopyableBuilder {
@Nullable
private final String delimiter;
@@ -114,18 +120,58 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link DelimitedPayloadTokenFilter}.
*/
- public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder {
+ public static class Builder extends TokenFilterBase.AbstractBuilder
+ implements
+ CopyableBuilder {
@Nullable
private String delimiter;
@Nullable
private DelimitedPayloadEncoding encoding;
+ public Builder() {}
+
+ private Builder(DelimitedPayloadTokenFilter o) {
+ super(o);
+ this.delimiter = o.delimiter;
+ this.encoding = o.encoding;
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.delimiter = o.delimiter;
+ this.encoding = o.encoding;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* API name: {@code delimiter}
*/
+ @Nonnull
public final Builder delimiter(@Nullable String value) {
this.delimiter = value;
return this;
@@ -134,21 +180,19 @@ public final Builder delimiter(@Nullable String value) {
/**
* API name: {@code encoding}
*/
+ @Nonnull
public final Builder encoding(@Nullable DelimitedPayloadEncoding value) {
this.encoding = value;
return this;
}
- @Override
- protected Builder self() {
- return this;
- }
-
/**
* Builds a {@link DelimitedPayloadTokenFilter}.
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public DelimitedPayloadTokenFilter build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DictionaryDecompounderTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DictionaryDecompounderTokenFilter.java
index ac742a25d1..9e0d1ab7c5 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DictionaryDecompounderTokenFilter.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DictionaryDecompounderTokenFilter.java
@@ -39,18 +39,24 @@
import jakarta.json.stream.JsonGenerator;
import java.util.function.Function;
import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.DictionaryDecompounderTokenFilter
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class DictionaryDecompounderTokenFilter extends CompoundWordTokenFilterBase implements TokenFilterDefinitionVariant {
+public class DictionaryDecompounderTokenFilter extends CompoundWordTokenFilterBase
+ implements
+ TokenFilterDefinitionVariant,
+ ToCopyableBuilder {
// ---------------------------------------------------------------------------------------------
@@ -79,14 +85,42 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link DictionaryDecompounderTokenFilter}.
*/
public static class Builder extends CompoundWordTokenFilterBase.AbstractBuilder
implements
- ObjectBuilder {
+ CopyableBuilder {
+
+ public Builder() {}
+
+ private Builder(DictionaryDecompounderTokenFilter o) {
+ super(o);
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ }
@Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
protected Builder self() {
return this;
}
@@ -96,6 +130,8 @@ protected Builder self() {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public DictionaryDecompounderTokenFilter build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DutchAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DutchAnalyzer.java
index acac1f2cab..f06908bac7 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DutchAnalyzer.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DutchAnalyzer.java
@@ -50,14 +50,16 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.DutchAnalyzer
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class DutchAnalyzer implements AnalyzerVariant, PlainJsonSerializable {
+public class DutchAnalyzer implements AnalyzerVariant, PlainJsonSerializable, ToCopyableBuilder {
@Nonnull
private final List stopwords;
@@ -112,13 +114,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link DutchAnalyzer}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
@Nullable
private List stopwords;
+ public Builder() {}
+
+ private Builder(DutchAnalyzer o) {
+ this.stopwords = _listCopy(o.stopwords);
+ }
+
+ private Builder(Builder o) {
+ this.stopwords = _listCopy(o.stopwords);
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
* API name: {@code stopwords}
*
@@ -126,6 +155,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to stopwords
.
*
*/
+ @Nonnull
public final Builder stopwords(List list) {
this.stopwords = _listAddAll(this.stopwords, list);
return this;
@@ -138,6 +168,7 @@ public final Builder stopwords(List list) {
* Adds one or more values to stopwords
.
*
*/
+ @Nonnull
public final Builder stopwords(String value, String... values) {
this.stopwords = _listAdd(this.stopwords, value, values);
return this;
@@ -148,6 +179,8 @@ public final Builder stopwords(String value, String... values) {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public DutchAnalyzer build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenFilter.java
index 8d375f817a..a246cf8b07 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenFilter.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenFilter.java
@@ -40,19 +40,25 @@
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.EdgeNGramTokenFilter
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class EdgeNGramTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant {
+public class EdgeNGramTokenFilter extends TokenFilterBase
+ implements
+ TokenFilterDefinitionVariant,
+ ToCopyableBuilder {
@Nullable
private final Integer maxGram;
@@ -146,10 +152,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link EdgeNGramTokenFilter}.
*/
- public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder {
+ public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder {
@Nullable
private Integer maxGram;
@Nullable
@@ -159,9 +176,40 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp
@Nullable
private EdgeNGramSide side;
+ public Builder() {}
+
+ private Builder(EdgeNGramTokenFilter o) {
+ super(o);
+ this.maxGram = o.maxGram;
+ this.minGram = o.minGram;
+ this.preserveOriginal = o.preserveOriginal;
+ this.side = o.side;
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.maxGram = o.maxGram;
+ this.minGram = o.minGram;
+ this.preserveOriginal = o.preserveOriginal;
+ this.side = o.side;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* API name: {@code max_gram}
*/
+ @Nonnull
public final Builder maxGram(@Nullable Integer value) {
this.maxGram = value;
return this;
@@ -170,6 +218,7 @@ public final Builder maxGram(@Nullable Integer value) {
/**
* API name: {@code min_gram}
*/
+ @Nonnull
public final Builder minGram(@Nullable Integer value) {
this.minGram = value;
return this;
@@ -178,6 +227,7 @@ public final Builder minGram(@Nullable Integer value) {
/**
* API name: {@code preserve_original}
*/
+ @Nonnull
public final Builder preserveOriginal(@Nullable Boolean value) {
this.preserveOriginal = value;
return this;
@@ -186,21 +236,19 @@ public final Builder preserveOriginal(@Nullable Boolean value) {
/**
* API name: {@code side}
*/
+ @Nonnull
public final Builder side(@Nullable EdgeNGramSide value) {
this.side = value;
return this;
}
- @Override
- protected Builder self() {
- return this;
- }
-
/**
* Builds a {@link EdgeNGramTokenFilter}.
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public EdgeNGramTokenFilter build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenizer.java
index 5432d050ca..400e05f2a0 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenizer.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenizer.java
@@ -49,13 +49,18 @@
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.EdgeNGramTokenizer
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class EdgeNGramTokenizer extends TokenizerBase implements TokenizerDefinitionVariant {
+public class EdgeNGramTokenizer extends TokenizerBase
+ implements
+ TokenizerDefinitionVariant,
+ ToCopyableBuilder {
@Nullable
private final String customTokenChars;
@@ -143,19 +148,61 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link EdgeNGramTokenizer}.
*/
- public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder {
+ public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder {
@Nullable
private String customTokenChars;
private Integer maxGram;
private Integer minGram;
private List tokenChars;
+ public Builder() {}
+
+ private Builder(EdgeNGramTokenizer o) {
+ super(o);
+ this.customTokenChars = o.customTokenChars;
+ this.maxGram = o.maxGram;
+ this.minGram = o.minGram;
+ this.tokenChars = _listCopy(o.tokenChars);
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.customTokenChars = o.customTokenChars;
+ this.maxGram = o.maxGram;
+ this.minGram = o.minGram;
+ this.tokenChars = _listCopy(o.tokenChars);
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* API name: {@code custom_token_chars}
*/
+ @Nonnull
public final Builder customTokenChars(@Nullable String value) {
this.customTokenChars = value;
return this;
@@ -164,6 +211,7 @@ public final Builder customTokenChars(@Nullable String value) {
/**
* Required - API name: {@code max_gram}
*/
+ @Nonnull
public final Builder maxGram(int value) {
this.maxGram = value;
return this;
@@ -172,6 +220,7 @@ public final Builder maxGram(int value) {
/**
* Required - API name: {@code min_gram}
*/
+ @Nonnull
public final Builder minGram(int value) {
this.minGram = value;
return this;
@@ -184,6 +233,7 @@ public final Builder minGram(int value) {
* Adds all elements of list
to tokenChars
.
*
*/
+ @Nonnull
public final Builder tokenChars(List list) {
this.tokenChars = _listAddAll(this.tokenChars, list);
return this;
@@ -196,21 +246,19 @@ public final Builder tokenChars(List list) {
* Adds one or more values to tokenChars
.
*
*/
+ @Nonnull
public final Builder tokenChars(TokenChar value, TokenChar... values) {
this.tokenChars = _listAdd(this.tokenChars, value, values);
return this;
}
- @Override
- protected Builder self() {
- return this;
- }
-
/**
* Builds a {@link EdgeNGramTokenizer}.
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public EdgeNGramTokenizer build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ElisionTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ElisionTokenFilter.java
index 161210982e..66ec0635df 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ElisionTokenFilter.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ElisionTokenFilter.java
@@ -49,13 +49,18 @@
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.ElisionTokenFilter
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class ElisionTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant {
+public class ElisionTokenFilter extends TokenFilterBase
+ implements
+ TokenFilterDefinitionVariant,
+ ToCopyableBuilder {
@Nonnull
private final List articles;
@@ -136,10 +141,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link ElisionTokenFilter}.
*/
- public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder {
+ public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder {
@Nullable
private List articles;
@Nullable
@@ -147,6 +163,34 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp
@Nullable
private String articlesPath;
+ public Builder() {}
+
+ private Builder(ElisionTokenFilter o) {
+ super(o);
+ this.articles = _listCopy(o.articles);
+ this.articlesCase = o.articlesCase;
+ this.articlesPath = o.articlesPath;
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.articles = _listCopy(o.articles);
+ this.articlesCase = o.articlesCase;
+ this.articlesPath = o.articlesPath;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* API name: {@code articles}
*
@@ -154,6 +198,7 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp
* Adds all elements of list
to articles
.
*
*/
+ @Nonnull
public final Builder articles(List list) {
this.articles = _listAddAll(this.articles, list);
return this;
@@ -166,6 +211,7 @@ public final Builder articles(List list) {
* Adds one or more values to articles
.
*
*/
+ @Nonnull
public final Builder articles(String value, String... values) {
this.articles = _listAdd(this.articles, value, values);
return this;
@@ -174,6 +220,7 @@ public final Builder articles(String value, String... values) {
/**
* API name: {@code articles_case}
*/
+ @Nonnull
public final Builder articlesCase(@Nullable Boolean value) {
this.articlesCase = value;
return this;
@@ -182,21 +229,19 @@ public final Builder articlesCase(@Nullable Boolean value) {
/**
* API name: {@code articles_path}
*/
+ @Nonnull
public final Builder articlesPath(@Nullable String value) {
this.articlesPath = value;
return this;
}
- @Override
- protected Builder self() {
- return this;
- }
-
/**
* Builds a {@link ElisionTokenFilter}.
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public ElisionTokenFilter build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintAnalyzer.java
index fb366da4be..55fd4c6ac6 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintAnalyzer.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintAnalyzer.java
@@ -50,14 +50,20 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.FingerprintAnalyzer
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class FingerprintAnalyzer implements AnalyzerVariant, PlainJsonSerializable {
+public class FingerprintAnalyzer
+ implements
+ AnalyzerVariant,
+ PlainJsonSerializable,
+ ToCopyableBuilder {
private final int maxOutputSize;
@@ -187,10 +193,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link FingerprintAnalyzer}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private Integer maxOutputSize;
private Boolean preserveOriginal;
private String separator;
@@ -201,9 +218,36 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to stopwords
.
*
*/
+ @Nonnull
public final Builder stopwords(List list) {
this.stopwords = _listAddAll(this.stopwords, list);
return this;
@@ -244,6 +291,7 @@ public final Builder stopwords(List list) {
* Adds one or more values to stopwords
.
*
*/
+ @Nonnull
public final Builder stopwords(String value, String... values) {
this.stopwords = _listAdd(this.stopwords, value, values);
return this;
@@ -252,6 +300,7 @@ public final Builder stopwords(String value, String... values) {
/**
* API name: {@code stopwords_path}
*/
+ @Nonnull
public final Builder stopwordsPath(@Nullable String value) {
this.stopwordsPath = value;
return this;
@@ -260,6 +309,7 @@ public final Builder stopwordsPath(@Nullable String value) {
/**
* API name: {@code version}
*/
+ @Nonnull
public final Builder version(@Nullable String value) {
this.version = value;
return this;
@@ -270,6 +320,8 @@ public final Builder version(@Nullable String value) {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public FingerprintAnalyzer build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintTokenFilter.java
index 47608314cb..3448028d88 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintTokenFilter.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintTokenFilter.java
@@ -40,19 +40,25 @@
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.FingerprintTokenFilter
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class FingerprintTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant {
+public class FingerprintTokenFilter extends TokenFilterBase
+ implements
+ TokenFilterDefinitionVariant,
+ ToCopyableBuilder {
@Nullable
private final Integer maxOutputSize;
@@ -112,18 +118,58 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link FingerprintTokenFilter}.
*/
- public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder {
+ public static class Builder extends TokenFilterBase.AbstractBuilder
+ implements
+ CopyableBuilder {
@Nullable
private Integer maxOutputSize;
@Nullable
private String separator;
+ public Builder() {}
+
+ private Builder(FingerprintTokenFilter o) {
+ super(o);
+ this.maxOutputSize = o.maxOutputSize;
+ this.separator = o.separator;
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.maxOutputSize = o.maxOutputSize;
+ this.separator = o.separator;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* API name: {@code max_output_size}
*/
+ @Nonnull
public final Builder maxOutputSize(@Nullable Integer value) {
this.maxOutputSize = value;
return this;
@@ -132,21 +178,19 @@ public final Builder maxOutputSize(@Nullable Integer value) {
/**
* API name: {@code separator}
*/
+ @Nonnull
public final Builder separator(@Nullable String value) {
this.separator = value;
return this;
}
- @Override
- protected Builder self() {
- return this;
- }
-
/**
* Builds a {@link FingerprintTokenFilter}.
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public FingerprintTokenFilter build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HtmlStripCharFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HtmlStripCharFilter.java
index b2563e5f43..57c2014839 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HtmlStripCharFilter.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HtmlStripCharFilter.java
@@ -39,18 +39,24 @@
import jakarta.json.stream.JsonGenerator;
import java.util.function.Function;
import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.HtmlStripCharFilter
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class HtmlStripCharFilter extends CharFilterBase implements CharFilterDefinitionVariant {
+public class HtmlStripCharFilter extends CharFilterBase
+ implements
+ CharFilterDefinitionVariant,
+ ToCopyableBuilder {
// ---------------------------------------------------------------------------------------------
@@ -77,12 +83,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link HtmlStripCharFilter}.
*/
- public static class Builder extends CharFilterBase.AbstractBuilder implements ObjectBuilder {
+ public static class Builder extends CharFilterBase.AbstractBuilder implements CopyableBuilder {
+
+ public Builder() {}
+
+ private Builder(HtmlStripCharFilter o) {
+ super(o);
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ }
@Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
protected Builder self() {
return this;
}
@@ -92,6 +126,8 @@ protected Builder self() {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public HtmlStripCharFilter build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HunspellTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HunspellTokenFilter.java
index 8854583339..c24c872b58 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HunspellTokenFilter.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HunspellTokenFilter.java
@@ -48,13 +48,18 @@
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.HunspellTokenFilter
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class HunspellTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant {
+public class HunspellTokenFilter extends TokenFilterBase
+ implements
+ TokenFilterDefinitionVariant,
+ ToCopyableBuilder {
@Nullable
private final Boolean dedup;
@@ -146,10 +151,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link HunspellTokenFilter}.
*/
- public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder {
+ public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder {
@Nullable
private Boolean dedup;
@Nullable
@@ -158,9 +174,40 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp
@Nullable
private Boolean longestOnly;
+ public Builder() {}
+
+ private Builder(HunspellTokenFilter o) {
+ super(o);
+ this.dedup = o.dedup;
+ this.dictionary = o.dictionary;
+ this.locale = o.locale;
+ this.longestOnly = o.longestOnly;
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.dedup = o.dedup;
+ this.dictionary = o.dictionary;
+ this.locale = o.locale;
+ this.longestOnly = o.longestOnly;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* API name: {@code dedup}
*/
+ @Nonnull
public final Builder dedup(@Nullable Boolean value) {
this.dedup = value;
return this;
@@ -169,6 +216,7 @@ public final Builder dedup(@Nullable Boolean value) {
/**
* API name: {@code dictionary}
*/
+ @Nonnull
public final Builder dictionary(@Nullable String value) {
this.dictionary = value;
return this;
@@ -177,6 +225,7 @@ public final Builder dictionary(@Nullable String value) {
/**
* Required - API name: {@code locale}
*/
+ @Nonnull
public final Builder locale(String value) {
this.locale = value;
return this;
@@ -185,21 +234,19 @@ public final Builder locale(String value) {
/**
* API name: {@code longest_only}
*/
+ @Nonnull
public final Builder longestOnly(@Nullable Boolean value) {
this.longestOnly = value;
return this;
}
- @Override
- protected Builder self() {
- return this;
- }
-
/**
* Builds a {@link HunspellTokenFilter}.
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public HunspellTokenFilter build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HyphenationDecompounderTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HyphenationDecompounderTokenFilter.java
index 5089977b5c..c6e359f9ad 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HyphenationDecompounderTokenFilter.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HyphenationDecompounderTokenFilter.java
@@ -39,18 +39,24 @@
import jakarta.json.stream.JsonGenerator;
import java.util.function.Function;
import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.HyphenationDecompounderTokenFilter
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class HyphenationDecompounderTokenFilter extends CompoundWordTokenFilterBase implements TokenFilterDefinitionVariant {
+public class HyphenationDecompounderTokenFilter extends CompoundWordTokenFilterBase
+ implements
+ TokenFilterDefinitionVariant,
+ ToCopyableBuilder {
// ---------------------------------------------------------------------------------------------
@@ -79,14 +85,42 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link HyphenationDecompounderTokenFilter}.
*/
public static class Builder extends CompoundWordTokenFilterBase.AbstractBuilder
implements
- ObjectBuilder {
+ CopyableBuilder {
+
+ public Builder() {}
+
+ private Builder(HyphenationDecompounderTokenFilter o) {
+ super(o);
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ }
@Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
protected Builder self() {
return this;
}
@@ -96,6 +130,8 @@ protected Builder self() {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public HyphenationDecompounderTokenFilter build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuAnalyzer.java
index 906df8ef2b..09b89b1812 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuAnalyzer.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuAnalyzer.java
@@ -47,14 +47,16 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.IcuAnalyzer
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class IcuAnalyzer implements AnalyzerVariant, PlainJsonSerializable {
+public class IcuAnalyzer implements AnalyzerVariant, PlainJsonSerializable, ToCopyableBuilder {
@Nonnull
private final IcuNormalizationType method;
@@ -118,16 +120,46 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link IcuAnalyzer}.
*/
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private IcuNormalizationType method;
private IcuNormalizationMode mode;
+ public Builder() {}
+
+ private Builder(IcuAnalyzer o) {
+ this.method = o.method;
+ this.mode = o.mode;
+ }
+
+ private Builder(Builder o) {
+ this.method = o.method;
+ this.mode = o.mode;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
* Required - API name: {@code method}
*/
+ @Nonnull
public final Builder method(IcuNormalizationType value) {
this.method = value;
return this;
@@ -136,6 +168,7 @@ public final Builder method(IcuNormalizationType value) {
/**
* Required - API name: {@code mode}
*/
+ @Nonnull
public final Builder mode(IcuNormalizationMode value) {
this.mode = value;
return this;
@@ -146,6 +179,8 @@ public final Builder mode(IcuNormalizationMode value) {
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public IcuAnalyzer build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuCollationTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuCollationTokenFilter.java
index f9a1668f35..492b699f62 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuCollationTokenFilter.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuCollationTokenFilter.java
@@ -40,19 +40,25 @@
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.IcuCollationTokenFilter
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class IcuCollationTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant {
+public class IcuCollationTokenFilter extends TokenFilterBase
+ implements
+ TokenFilterDefinitionVariant,
+ ToCopyableBuilder {
@Nullable
private final IcuCollationAlternate alternate;
@@ -282,10 +288,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link IcuCollationTokenFilter}.
*/
- public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder {
+ public static class Builder extends TokenFilterBase.AbstractBuilder
+ implements
+ CopyableBuilder {
@Nullable
private IcuCollationAlternate alternate;
@Nullable
@@ -311,9 +330,56 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp
@Nullable
private String variant;
+ public Builder() {}
+
+ private Builder(IcuCollationTokenFilter o) {
+ super(o);
+ this.alternate = o.alternate;
+ this.caseFirst = o.caseFirst;
+ this.caseLevel = o.caseLevel;
+ this.country = o.country;
+ this.decomposition = o.decomposition;
+ this.hiraganaQuaternaryMode = o.hiraganaQuaternaryMode;
+ this.language = o.language;
+ this.numeric = o.numeric;
+ this.rules = o.rules;
+ this.strength = o.strength;
+ this.variableTop = o.variableTop;
+ this.variant = o.variant;
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.alternate = o.alternate;
+ this.caseFirst = o.caseFirst;
+ this.caseLevel = o.caseLevel;
+ this.country = o.country;
+ this.decomposition = o.decomposition;
+ this.hiraganaQuaternaryMode = o.hiraganaQuaternaryMode;
+ this.language = o.language;
+ this.numeric = o.numeric;
+ this.rules = o.rules;
+ this.strength = o.strength;
+ this.variableTop = o.variableTop;
+ this.variant = o.variant;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* API name: {@code alternate}
*/
+ @Nonnull
public final Builder alternate(@Nullable IcuCollationAlternate value) {
this.alternate = value;
return this;
@@ -322,6 +388,7 @@ public final Builder alternate(@Nullable IcuCollationAlternate value) {
/**
* API name: {@code caseFirst}
*/
+ @Nonnull
public final Builder caseFirst(@Nullable IcuCollationCaseFirst value) {
this.caseFirst = value;
return this;
@@ -330,6 +397,7 @@ public final Builder caseFirst(@Nullable IcuCollationCaseFirst value) {
/**
* API name: {@code caseLevel}
*/
+ @Nonnull
public final Builder caseLevel(@Nullable Boolean value) {
this.caseLevel = value;
return this;
@@ -338,6 +406,7 @@ public final Builder caseLevel(@Nullable Boolean value) {
/**
* API name: {@code country}
*/
+ @Nonnull
public final Builder country(@Nullable String value) {
this.country = value;
return this;
@@ -346,6 +415,7 @@ public final Builder country(@Nullable String value) {
/**
* API name: {@code decomposition}
*/
+ @Nonnull
public final Builder decomposition(@Nullable IcuCollationDecomposition value) {
this.decomposition = value;
return this;
@@ -354,6 +424,7 @@ public final Builder decomposition(@Nullable IcuCollationDecomposition value) {
/**
* API name: {@code hiraganaQuaternaryMode}
*/
+ @Nonnull
public final Builder hiraganaQuaternaryMode(@Nullable Boolean value) {
this.hiraganaQuaternaryMode = value;
return this;
@@ -362,6 +433,7 @@ public final Builder hiraganaQuaternaryMode(@Nullable Boolean value) {
/**
* API name: {@code language}
*/
+ @Nonnull
public final Builder language(@Nullable String value) {
this.language = value;
return this;
@@ -370,6 +442,7 @@ public final Builder language(@Nullable String value) {
/**
* API name: {@code numeric}
*/
+ @Nonnull
public final Builder numeric(@Nullable Boolean value) {
this.numeric = value;
return this;
@@ -378,6 +451,7 @@ public final Builder numeric(@Nullable Boolean value) {
/**
* API name: {@code rules}
*/
+ @Nonnull
public final Builder rules(@Nullable String value) {
this.rules = value;
return this;
@@ -386,6 +460,7 @@ public final Builder rules(@Nullable String value) {
/**
* API name: {@code strength}
*/
+ @Nonnull
public final Builder strength(@Nullable IcuCollationStrength value) {
this.strength = value;
return this;
@@ -394,6 +469,7 @@ public final Builder strength(@Nullable IcuCollationStrength value) {
/**
* API name: {@code variableTop}
*/
+ @Nonnull
public final Builder variableTop(@Nullable String value) {
this.variableTop = value;
return this;
@@ -402,21 +478,19 @@ public final Builder variableTop(@Nullable String value) {
/**
* API name: {@code variant}
*/
+ @Nonnull
public final Builder variant(@Nullable String value) {
this.variant = value;
return this;
}
- @Override
- protected Builder self() {
- return this;
- }
-
/**
* Builds a {@link IcuCollationTokenFilter}.
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public IcuCollationTokenFilter build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuFoldingTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuFoldingTokenFilter.java
index e68308484a..abe7a0d67f 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuFoldingTokenFilter.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuFoldingTokenFilter.java
@@ -46,13 +46,18 @@
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.IcuFoldingTokenFilter
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class IcuFoldingTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant {
+public class IcuFoldingTokenFilter extends TokenFilterBase
+ implements
+ TokenFilterDefinitionVariant,
+ ToCopyableBuilder {
@Nonnull
private final String unicodeSetFilter;
@@ -93,30 +98,65 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link IcuFoldingTokenFilter}.
*/
- public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder {
+ public static class Builder extends TokenFilterBase.AbstractBuilder
+ implements
+ CopyableBuilder {
private String unicodeSetFilter;
+ public Builder() {}
+
+ private Builder(IcuFoldingTokenFilter o) {
+ super(o);
+ this.unicodeSetFilter = o.unicodeSetFilter;
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.unicodeSetFilter = o.unicodeSetFilter;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* Required - API name: {@code unicode_set_filter}
*/
+ @Nonnull
public final Builder unicodeSetFilter(String value) {
this.unicodeSetFilter = value;
return this;
}
- @Override
- protected Builder self() {
- return this;
- }
-
/**
* Builds a {@link IcuFoldingTokenFilter}.
*
* @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public IcuFoldingTokenFilter build() {
_checkSingleUse();
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuNormalizationCharFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuNormalizationCharFilter.java
index fe85c7f0b1..ab78c4b283 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuNormalizationCharFilter.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuNormalizationCharFilter.java
@@ -40,19 +40,25 @@
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: _types.analysis.IcuNormalizationCharFilter
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class IcuNormalizationCharFilter extends CharFilterBase implements CharFilterDefinitionVariant {
+public class IcuNormalizationCharFilter extends CharFilterBase
+ implements
+ CharFilterDefinitionVariant,
+ ToCopyableBuilder {
@Nullable
private final IcuNormalizationMode mode;
@@ -114,18 +120,58 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link IcuNormalizationCharFilter}.
*/
- public static class Builder extends CharFilterBase.AbstractBuilder