Skip to content

Commit

Permalink
Add wrapper to builder
Browse files Browse the repository at this point in the history
Signed-off-by: Urs Keller <[email protected]>
  • Loading branch information
ukeller committed Jan 12, 2024
1 parent 1a5fc11 commit cf4f928
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ 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))
- Expose HTTP status code through `ResponseException#status` ([#756](https://github.com/opensearch-project/opensearch-java/pull/756))
- Added missing WrapperQuery accessors and builder methods ([#806](https://github.com/opensearch-project/opensearch-java/pull/806))


### Dependencies

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,23 @@ public WildcardQuery wildcard() {
return TaggedUnionUtils.get(this, Kind.Wildcard);
}

/**
* Is this variant instance of kind {@code wrapper}?
*/
public boolean isWrapper() {
return this._kind == Query.Kind.Wrapper;
}

/**
* Get the {@code wrapper} variant value.
*
* @throws IllegalStateException
* if the current variant is not of the {@code wrapper} kind.
*/
public WrapperQuery wrapper() {
return (WrapperQuery) TaggedUnionUtils.get(this, Query.Kind.Wrapper);
}

/**
* Is this variant instance of kind {@code type}?
*/
Expand Down Expand Up @@ -1743,6 +1760,16 @@ public ObjectBuilder<Query> wildcard(Function<WildcardQuery.Builder, ObjectBuild
return this.wildcard(fn.apply(new WildcardQuery.Builder()).build());
}

public ObjectBuilder<Query> wrapper(WrapperQuery v) {
this._kind = Query.Kind.Wrapper;
this._value = v;
return this;
}

public ObjectBuilder<Query> wrapper(Function<WrapperQuery.Builder, ObjectBuilder<WrapperQuery>> fn) {
return this.wrapper(fn.apply(new WrapperQuery.Builder()).build());
}

public ObjectBuilder<Query> type(TypeQuery v) {
this._kind = Kind.Type;
this._value = v;
Expand Down

0 comments on commit cf4f928

Please sign in to comment.