kv: build range request using OptionUtil to convert SortOrder and SortTarget
package com.coreos.jetcd.internal.impl;
+import static com.coreos.jetcd.options.OptionsUtil.toRangeRequestSortOrder;
+import static com.coreos.jetcd.options.OptionsUtil.toRangeRequestSortTarget;
import static com.google.common.base.Preconditions.checkNotNull;
import com.coreos.jetcd.KV;
@@ -77,8 +79,8 @@ class KVImpl implements KV {
.setRevision(option.getRevision())
.setKeysOnly(option.isKeysOnly())
.setSerializable(option.isSerializable())
- .setSortOrder(option.getSortOrder())
- .setSortTarget(option.getSortField());
+ .setSortOrder(toRangeRequestSortOrder(option.getSortOrder()))
+ .setSortTarget(toRangeRequestSortTarget(option.getSortField()));
option.getEndKey().ifPresent((endKey) ->
builder.setRangeEnd(Util.byteStringFromByteSequence(endKey)));
