Class CounterValue
java.lang.Object
org.infinispan.counter.impl.entries.CounterValue
Stores the counter's value and
CounterState.
If the counter isn't bounded, the state is always CounterState.VALID.
- Since:
- 9.0
- Author:
- Pedro Ruivo
-
Method Summary
Modifier and TypeMethodDescriptionbooleanorg.infinispan.counter.api.CounterStategetState()longgetValue()inthashCode()static CounterValuenewCounterValue(long value) Creates a new validCounterValuewith the value.static CounterValuenewCounterValue(long value, long lowerBound, long upperBound) Creates a newCounterValuewith the value and state based on the boundaries.static CounterValuenewCounterValue(long currentValue, org.infinispan.counter.api.CounterConfiguration configuration) static CounterValuenewCounterValue(long value, org.infinispan.counter.api.CounterState state) Creates a newCounterValuewith the value and state.static CounterValuenewCounterValue(org.infinispan.counter.api.CounterConfiguration configuration) Creates the initialCounterValuebased onCounterConfiguration.toString()
-
Method Details
-
newCounterValue
Creates a new validCounterValuewith the value.- Parameters:
value- the counter's value.- Returns:
- the
CounterValue.
-
newCounterValue
Creates a newCounterValuewith the value and state based on the boundaries.- Parameters:
value- the counter's value.lowerBound- the counter's lower bound.upperBound- the counter's upper bound.- Returns:
- the
CounterValue.
-
newCounterValue
public static CounterValue newCounterValue(long value, org.infinispan.counter.api.CounterState state) Creates a newCounterValuewith the value and state.- Parameters:
value- the counter's value.state- the counter's state.- Returns:
- the
CounterValue.
-
newCounterValue
public static CounterValue newCounterValue(org.infinispan.counter.api.CounterConfiguration configuration) Creates the initialCounterValuebased onCounterConfiguration.- Parameters:
configuration- the configuration.- Returns:
- the
CounterValue.
-
newCounterValue
public static CounterValue newCounterValue(long currentValue, org.infinispan.counter.api.CounterConfiguration configuration) - Parameters:
currentValue- the current counter's value.configuration- the configuration.- Returns:
- the
CounterValue.
-
getValue
@ProtoField(number=1, defaultValue="0") public long getValue()- Returns:
- the counter's value.
-
getState
@ProtoField(2) public org.infinispan.counter.api.CounterState getState()- Returns:
- the counter's state.
-
equals
-
hashCode
public int hashCode() -
toString
-