Skip to content

java-client/src/main/java/co/elastic/clients/elasticsearch/indices/update_aliases/Action.java The Builder of Action of updateAliases should use [return self()] instead of [return this] and change the return type to [Builder] #884

@Jiuyoung

Description

@Jiuyoung

Java API client version

8.15.1

Java version

11

Elasticsearch Version

8.15.0

Problem description

The following is the relevant code, which is causing the inability to achieve chaining as expected.

public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<Action> {
private Kind _kind;
private Object _value;
@Override
protected Builder self() {
return this;
}
public ObjectBuilder<Action> add(AddAction v) {
this._kind = Kind.Add;
this._value = v;
return this;
}
public ObjectBuilder<Action> add(Function<AddAction.Builder, ObjectBuilder<AddAction>> fn) {
return this.add(fn.apply(new AddAction.Builder()).build());
}
public ObjectBuilder<Action> remove(RemoveAction v) {
this._kind = Kind.Remove;
this._value = v;
return this;
}
public ObjectBuilder<Action> remove(Function<RemoveAction.Builder, ObjectBuilder<RemoveAction>> fn) {
return this.remove(fn.apply(new RemoveAction.Builder()).build());
}
public ObjectBuilder<Action> removeIndex(RemoveIndexAction v) {
this._kind = Kind.RemoveIndex;
this._value = v;
return this;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Category: QuestionNot an issue but a question. May lead to enhancing docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions