Class IdentityProjection<K,V>

java.lang.Object
com.loomcache.server.compute.IdentityProjection<K,V>
Type Parameters:
K - the type of the key
V - the type of the value
All Implemented Interfaces:
Projection<K, V, Map.Entry<K,V>>

public class IdentityProjection<K,V> extends Object implements Projection<K, V, Map.Entry<K,V>>
Built-in projection that returns the entire Map.Entry unchanged.

Usage:

  Projectioninvalid input: '<'String, Integer, Map.Entryinvalid input: '<'String, Integer>> identity =
      new IdentityProjectioninvalid input: '<'>();
  Listinvalid input: '<'Map.Entryinvalid input: '<'String, Integer>> entries = executor.project(identity);
  • Constructor Details

    • IdentityProjection

      public IdentityProjection()
      Create a new identity projection.
  • Method Details

    • transform

      public Map.Entry<K,V> transform(Map.Entry<K,V> entry)
      Description copied from interface: Projection
      Transform a map entry to the projected result.
      Specified by:
      transform in interface Projection<K, V, Map.Entry<K,V>>
      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