@Retention(value=RUNTIME) @Target(value=FIELD) public @interface Incrementing
Map of numbers.
By default, the property is only allowed to increment over time.
For maps, it's the element at a given key that must not decrement.
Regarding storage, it's not the actual value that is sent when invoking PersistingElement.store(), but the difference.
The situation is illustrated by the following example:
@Persisting public class MyClass {@Incrementing public int anInt;}
MyClass mc1 = new MyClass(); mc1.anInt = 3; mc1.store();
MyClass mc2 = new MyClass(); mc2.anInt = 2; mc2.store();
MyClass mc3 = new MyClass(); mc3.activate(); assert mc3.anInt == 5;
| Modifier and Type | Optional Element and Description |
|---|---|
Incrementing.Mode |
mode
Whether the incrementing property is allowed to increment or decrement over time.
|
public abstract Incrementing.Mode mode
IncrementException is thrown if constraint set by mode is not enforced.
As there is no mean to state a default value, Incrementing.Mode.IncrementOnly properties must be positive and Incrementing.Mode.IncrementOnly must be negative.Copyright © 2016. All Rights Reserved.