summaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2019-10-14 11:18:18 +0200
committerJon Bratseth <bratseth@verizonmedia.com>2019-10-14 11:18:18 +0200
commit8f610691c6b235566c89f048dda3f24411cdb556 (patch)
treee347c2a7ebbade7b61b3eee5e04d74949b25963b /container-search
parentd2b8a469eea90b6d55023d92b6b8404e3b7dce2b (diff)
Add constructor for controlling end value include/exclude
Diffstat (limited to 'container-search')
-rw-r--r--container-search/abi-spec.json1
-rw-r--r--container-search/src/main/java/com/yahoo/search/grouping/request/StringBucket.java16
2 files changed, 16 insertions, 1 deletions
diff --git a/container-search/abi-spec.json b/container-search/abi-spec.json
index 4f3e17deb07..723a50dc4a9 100644
--- a/container-search/abi-spec.json
+++ b/container-search/abi-spec.json
@@ -3616,6 +3616,7 @@
"public void <init>(java.lang.String)",
"public void <init>(com.yahoo.search.grouping.request.StringValue)",
"public void <init>(java.lang.String, java.lang.String)",
+ "public void <init>(java.lang.String, java.lang.String, boolean)",
"public void <init>(com.yahoo.search.grouping.request.ConstantValue, com.yahoo.search.grouping.request.ConstantValue)",
"public com.yahoo.search.grouping.request.StringBucket copy()",
"public bridge synthetic com.yahoo.search.grouping.request.BucketValue copy()",
diff --git a/container-search/src/main/java/com/yahoo/search/grouping/request/StringBucket.java b/container-search/src/main/java/com/yahoo/search/grouping/request/StringBucket.java
index c0bea7003c0..12374fbc60d 100644
--- a/container-search/src/main/java/com/yahoo/search/grouping/request/StringBucket.java
+++ b/container-search/src/main/java/com/yahoo/search/grouping/request/StringBucket.java
@@ -30,7 +30,21 @@ public class StringBucket extends BucketValue {
* @param to the end of the bucket, exclusive
*/
public StringBucket(String from, String to) {
- super(null, null, new StringValue(from), new StringValue(to));
+ this(from, to, false);
+ }
+
+ /**
+ * Constructs a new bucket for a range of strings.
+ *
+ * @param from the start of the bucket, inclusive
+ * @param to the end of the bucket
+ * @param toInclusive whether <code>to</code> value should be included in the bucket
+ */
+ public StringBucket(String from, String to, boolean toInclusive) {
+ super(null,
+ null,
+ new StringValue(from),
+ toInclusive ? nextValue(new StringValue(to)) : new StringValue(to));
}
/**