for compatible.
package io.etcd.jetcd.options;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import io.etcd.jetcd.KV;
import java.util.Optional;
import io.etcd.jetcd.ByteSequence;
@@ -178,6 +181,25 @@ public final class GetOption {
return this;
}
+ /**
+ * Enables 'Get' requests to obtain all the keys with matching prefix.
+ *
+ * <p>
+ * You should pass the key that is passed into
+ * {@link KV#get(ByteSequence) KV.get} method into this method as the given key.
+ *
+ * @param prefix the common prefix of all the keys that you want to get
+ * @return builder
+ * @deprecated Use {@link #withPrefix(boolean)} instead.
+ */
+ @Deprecated
+ public Builder withPrefix(ByteSequence prefix) {
+ checkNotNull(prefix, "prefix should not be null");
+ ByteSequence prefixEnd = OptionsUtil.prefixEndOf(prefix);
+ this.withRange(prefixEnd);
+ return this;
+ }
+
/**
* Limit returned keys to those with create revision greater than the provided value.
* min_create_revision is the lower bound for returned key create revisions; all keys with
