Skip to content

Commit

Permalink
rename _toQuery() to toQuery()
Browse files Browse the repository at this point in the history
  • Loading branch information
channel-dante committed Dec 7, 2023
1 parent 863518c commit 3f59a4a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ public interface QueryVariant {

Query.Kind _queryKind();

@Deprecated
default Query _toQuery() {
return new Query(this);
}

default Query toQuery() {
return new Query(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@
public class Query implements TaggedUnion<Query.Kind, Query.Variant>, JsonpSerializable {

public interface Variant extends UnionVariant<Kind>, JsonpSerializable {
@Deprecated
default Query _toQuery() {
return new Query(this);
}

default Query toQuery() {
return new Query(this);
}
}

public enum Kind implements JsonEnum {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void testQuery() {
Query.Variant v = q._get();
assertEquals(Query.Kind.Bool, v._variantType());

Query q1 = v._toQuery();
Query q1 = v.toQuery();

Collection<Query> must = q.bool().must();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,9 @@ public void testSubAggregation() throws IOException {
.filter(
BoolQuery.of(
_5 -> _5.filter(
List.of(TermsQuery.of(_6 -> _6.field("color.keyword").terms(_7 -> _7.value(fieldValues)))._toQuery())
List.of(TermsQuery.of(_6 -> _6.field("color.keyword").terms(_7 -> _7.value(fieldValues))).toQuery())
)
)._toQuery()
).toQuery()
)
)
);
Expand Down

0 comments on commit 3f59a4a

Please sign in to comment.