diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-11-02 11:07:19 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2022-11-02 11:07:19 +0100 |
commit | 933f874a3a8d10bad01f07942a65d25165d4fcfa (patch) | |
tree | 7b9623703f323081a0e945b7fb93722e5cf76fe8 /client/src/main | |
parent | 349e575f85448b66789cdf42444b7779460970a0 (diff) |
Deprecate semicolon()
Diffstat (limited to 'client/src/main')
-rw-r--r-- | client/src/main/java/ai/vespa/client/dsl/EndQuery.java | 14 | ||||
-rw-r--r-- | client/src/main/java/ai/vespa/client/dsl/Query.java | 22 |
2 files changed, 28 insertions, 8 deletions
diff --git a/client/src/main/java/ai/vespa/client/dsl/EndQuery.java b/client/src/main/java/ai/vespa/client/dsl/EndQuery.java index 61ffe84e5a9..1550186342e 100644 --- a/client/src/main/java/ai/vespa/client/dsl/EndQuery.java +++ b/client/src/main/java/ai/vespa/client/dsl/EndQuery.java @@ -76,15 +76,21 @@ public class EndQuery { } /** - * Semicolon. - * turn a query into fixed query. + * Calls fix() * - * @return the fixed query + * @deprecated use {link #fix} */ - public FixedQuery semicolon() { + @Deprecated // TODO: Remove on Vespa 9 + public FixedQuery semicolon() { return fix(); } + + /** Returns a fixed query containing this. */ + public FixedQuery fix() { return new FixedQuery(this); } + /** Calls fix().build() */ + public String build() { return fix().build(); } + /** * Group. * https://docs.vespa.ai/en/reference/query-language-reference.html#grouping diff --git a/client/src/main/java/ai/vespa/client/dsl/Query.java b/client/src/main/java/ai/vespa/client/dsl/Query.java index bc5be2280c4..36718ced814 100644 --- a/client/src/main/java/ai/vespa/client/dsl/Query.java +++ b/client/src/main/java/ai/vespa/client/dsl/Query.java @@ -290,13 +290,27 @@ public class Query extends QueryChain { } /** - * Semicolon. - * turn a query into fixed query. + * Calls fix() * * @return the fixed query + * @deprecated use {@link #fix()}, {@link #end()} or {@link #build} instead */ - public FixedQuery semicolon() { - return new FixedQuery(new EndQuery(this)); + @Deprecated // TODO: Remove on Vespa 9 + public FixedQuery semicolon() { return fix(); } + + /** Returns this as an ended query. */ + public EndQuery end() { + return new EndQuery(this); + } + + /** Calls end().fix(). */ + public FixedQuery fix() { + return end().fix(); + } + + /** Calls fix().build(). */ + public String build() { + return fix().build(); } @Override |