|
14 | 14 | public interface LiveCounter extends LiveCounterChange { |
15 | 15 |
|
16 | 16 | /** |
17 | | - * Increments the value of the counter by 1. |
| 17 | + * Increments the value of the counter by the specified amount. |
18 | 18 | * Send a COUNTER_INC operation to the realtime system to increment a value on this LiveCounter object. |
19 | 19 | * This does not modify the underlying data of this LiveCounter object. Instead, the change will be applied when |
20 | 20 | * the published COUNTER_INC operation is echoed back to the client and applied to the object following the regular |
21 | 21 | * operation application procedure. |
| 22 | + * Spec: RTLC12 |
| 23 | + * |
| 24 | + * @param amount the amount by which to increment the counter |
| 25 | + */ |
| 26 | + @Blocking |
| 27 | + void increment(@NotNull Number amount); |
| 28 | + |
| 29 | + /** |
| 30 | + * Decrements the value of the counter by the specified amount. |
| 31 | + * An alias for calling {@link LiveCounter#increment(Number)} with a negative amount. |
| 32 | + * Spec: RTLC13 |
| 33 | + * |
| 34 | + * @param amount the amount by which to decrement the counter |
22 | 35 | */ |
23 | 36 | @Blocking |
24 | | - void increment(); |
| 37 | + void decrement(@NotNull Number amount); |
25 | 38 |
|
26 | 39 | /** |
27 | | - * Increments the value of the counter by 1 asynchronously. |
| 40 | + * Increments the value of the counter by the specified amount asynchronously. |
28 | 41 | * Send a COUNTER_INC operation to the realtime system to increment a value on this LiveCounter object. |
29 | 42 | * This does not modify the underlying data of this LiveCounter object. Instead, the change will be applied when |
30 | 43 | * the published COUNTER_INC operation is echoed back to the client and applied to the object following the regular |
31 | 44 | * operation application procedure. |
| 45 | + * Spec: RTLC12 |
32 | 46 | * |
| 47 | + * @param amount the amount by which to increment the counter |
33 | 48 | * @param callback the callback to be invoked upon completion of the operation. |
34 | 49 | */ |
35 | 50 | @NonBlocking |
36 | | - void incrementAsync(@NotNull Callback<Void> callback); |
37 | | - |
38 | | - /** |
39 | | - * Decrements the value of the counter by 1. |
40 | | - * An alias for calling {@link LiveCounter#increment()} with a negative amount. |
41 | | - */ |
42 | | - @Blocking |
43 | | - void decrement(); |
| 51 | + void incrementAsync(@NotNull Number amount, @NotNull Callback<Void> callback); |
44 | 52 |
|
45 | 53 | /** |
46 | | - * Decrements the value of the counter by 1 asynchronously. |
47 | | - * An alias for calling {@link LiveCounter#increment()} with a negative amount. |
| 54 | + * Decrements the value of the counter by the specified amount asynchronously. |
| 55 | + * An alias for calling {@link LiveCounter#incrementAsync(Number, Callback)} with a negative amount. |
| 56 | + * Spec: RTLC13 |
48 | 57 | * |
| 58 | + * @param amount the amount by which to decrement the counter |
49 | 59 | * @param callback the callback to be invoked upon completion of the operation. |
50 | 60 | */ |
51 | 61 | @NonBlocking |
52 | | - void decrementAsync(@NotNull Callback<Void> callback); |
| 62 | + void decrementAsync(@NotNull Number amount, @NotNull Callback<Void> callback); |
53 | 63 |
|
54 | 64 | /** |
55 | 65 | * Retrieves the current value of the counter. |
56 | 66 | * |
57 | | - * @return the current value of the counter as a Long. |
| 67 | + * @return the current value of the counter as a Double. |
58 | 68 | */ |
59 | 69 | @NotNull |
60 | 70 | @Contract(pure = true) // Indicates this method does not modify the state of the object. |
|
0 commit comments