Skip to content

Commit ccb99b1

Browse files
committed
fixed merge register assign operation
1 parent 219c403 commit ccb99b1

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/main/java/eu/antidotedb/client/MergeRegisterKey.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.google.protobuf.ByteString;
44
import eu.antidotedb.antidotepb.AntidotePB;
55

6+
import javax.annotation.CheckReturnValue;
67
import java.util.List;
78

89
public class MergeRegisterKey<V> extends Key<V> {
@@ -23,4 +24,14 @@ public interface ValueMerger<V> {
2324
V readResponseToValue(AntidotePB.ApbReadObjectResp resp) {
2425
return merger.merge(ResponseDecoder.multiValueRegister(format).readResponseToValue(resp));
2526
}
27+
28+
/**
29+
* Creates an update operation which assigns a new value to the register.
30+
* <p>
31+
* Use the methods on {@link Bucket} to execute the update.
32+
*/
33+
@CheckReturnValue
34+
public UpdateOpDefaultImpl assign(V value) {
35+
return RegisterKey.buildRegisterUpdate(this, format.encode(value));
36+
}
2637
}

0 commit comments

Comments
 (0)