Interface ReadOnlyCacheEntryProcessor<K,V,R>

Type Parameters:
K - the type of the key
V - the type of the value
R - the type of the result returned by the processor
All Superinterfaces:
CacheEntryProcessor<K,V,R>

public interface ReadOnlyCacheEntryProcessor<K,V,R> extends CacheEntryProcessor<K,V,R>
Cache entry processor that signals read-only intent.

ReadOnlyCacheEntryProcessor implementations do not modify the entry they process. The EntryProcessorExecutor optimizes for read-only processors by skipping expensive lock acquisition and providing a read-only view of the entry.

Attempting to call setValue or remove on the read-only entry will throw UnsupportedOperationException.

Usage:

  ReadOnlyCacheEntryProcessorinvalid input: '<'String, Integer, Integer> reader = entry -> {
      return entry.value();
  };
  Integer result = map.processEntry("key", reader);