Update LLDictionary.java and LLRange.java

This commit is contained in:
Andrea Cavalli 2021-01-30 19:27:59 +01:00
parent 3ad9efe71f
commit 68bd86567c
2 changed files with 10 additions and 0 deletions

View File

@ -22,6 +22,8 @@ public interface LLDictionary extends LLKeyValueDatabaseStructure {
Flux<Entry<byte[], byte[]>> getRange(@Nullable LLSnapshot snapshot, LLRange range);
Flux<byte[]> getRangeKeys(@Nullable LLSnapshot snapshot, LLRange range);
Flux<Entry<byte[], byte[]>> setRange(LLRange range, Flux<Entry<byte[], byte[]>> entries, boolean getOldValues);
default Mono<Void> replaceRange(LLRange range, boolean canKeysChange, Function<Entry<byte[], byte[]>, Mono<Entry<byte[], byte[]>>> entriesReplacer) {

View File

@ -26,6 +26,14 @@ public class LLRange {
return new LLRange(null, max);
}
public static LLRange single(byte[] single) {
return new LLRange(single, single);
}
public static LLRange of(byte[] min, byte[] max) {
return new LLRange(min, max);
}
public boolean isAll() {
return min == null && max == null;
}