Construct a ConditionalPutAll processor that updates an entry with a new value if and only if the filter applied to the entry evaluates to true. The new value is extracted from the specified map based on the entry's key.
the filter to evaluate all supplied entries
a map of values to update entries with
Specifies the new value to update an entry with.
The underlying filter.
Returns a CompositeProcessor comprised of this and the provided processor.
a CompositeProcessor comprised of this and the provided processor
the next processor
Returns a ConditionalProcessor comprised of this processor and the provided filter.
The specified entry processor gets invoked if and only if the filter
applied to the entry evaluates to true
; otherwise the
result of the invocation will return null
.
the filter
/** ConditionalPutAll is an EntryProcessor that performs an update operation for multiple entries that satisfy the specified condition.
This allows for concurrent insertion/update of values within the cache. For example a concurrent
replaceAll(map)
could be implemented as:or
putAllIfAbsent
could be done by inverting the filter:Obviously, using more specific, fine-tuned filters may provide additional flexibility and efficiency allowing the multi-put operations to be performed conditionally on values of specific attributes (or even calculations) instead of a simple existence check.