Interface Projection<K,V,R>

Type Parameters:
K - the type of the key
V - the type of the value
R - the type of the projected result
All Known Implementing Classes:
IdentityProjection, MultiAttributeProjection, SingleAttributeProjection

public interface Projection<K,V,R>
Interface for extracting subsets of entry data.

Projections allow transforming entries into a different representation, typically extracting only specific fields or computing derived values from a read-only snapshot of the entry. Use CacheEntryProcessor for atomic cache mutations.

Usage example:

  Projectioninvalid input: '<'String, Person, String> nameProjection =
      entry -> entry.getValue().getName();
  List names = executor.project(nameProjection);
  • Method Summary

    Modifier and Type
    Method
    Description
    Transform a map entry to the projected result.
  • Method Details

    • transform

      R transform(Map.Entry<K,V> entry)
      Transform a map entry to the projected result.
      Parameters:
      entry - the detached, immutable entry snapshot to transform; the server provides a read-only snapshot, and direct callers must do the same because invoking Map.Entry.setValue(Object) never updates cache state and is unsupported
      Returns:
      the projected result