Class CreateAndCASFunction<K extends CounterKey>
java.lang.Object
org.infinispan.counter.impl.function.CreateAndCASFunction<K>
- All Implemented Interfaces:
Function<org.infinispan.functional.EntryView.ReadWriteEntryView<K,CounterValue>, Object>
The compare-and-swap function to update the
CounterValue.
It has the same semantic as CompareAndSwapFunction but it creates the CounterValue if it doesn't
exist.
- Since:
- 9.2
- Author:
- Pedro Ruivo
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.infinispan.commons.marshall.AdvancedExternalizer<CreateAndCASFunction> -
Constructor Summary
ConstructorsConstructorDescriptionCreateAndCASFunction(org.infinispan.counter.api.CounterConfiguration configuration, long expect, long value) -
Method Summary
Modifier and TypeMethodDescriptionfinal Objectapply(org.infinispan.functional.EntryView.ReadWriteEntryView<K, CounterValue> entryView)
-
Field Details
-
EXTERNALIZER
public static final org.infinispan.commons.marshall.AdvancedExternalizer<CreateAndCASFunction> EXTERNALIZER
-
-
Constructor Details
-
CreateAndCASFunction
public CreateAndCASFunction(org.infinispan.counter.api.CounterConfiguration configuration, long expect, long value)
-
-
Method Details
-
apply
public final Object apply(org.infinispan.functional.EntryView.ReadWriteEntryView<K, CounterValue> entryView) - Specified by:
applyin interfaceFunction<K extends CounterKey,R>
-