Class MutableEntry<K,V>

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

public class MutableEntry<K,V> extends Object implements CacheEntryProcessor.Entry<K,V>
Mutable entry implementation that wraps a map entry and tracks modifications.

This class is used internally by EntryProcessorExecutor to provide a mutable view of an entry during processor execution. It tracks whether the entry was modified, removed, or left unchanged.

Thread safety: This class is designed for single-threaded use within the context of an entry processor execution (which is locked by EntryProcessorExecutor).

  • Constructor Summary

    Constructors
    Constructor
    Description
    MutableEntry(K key, @Nullable V value, boolean exists)
    Create a new MutableEntry for an existing entry.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Check if this entry exists in the map.
    @Nullable V
    Get the new value (after modification, if any).
    key()
    Get the key of this entry.
    void
    Remove this entry from the map.
    void
    setValue(@Nullable V value)
    Set the value of this entry.
    @Nullable V
    Get the current value of this entry.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MutableEntry

      public MutableEntry(K key, @Nullable V value, boolean exists)
      Create a new MutableEntry for an existing entry.
      Parameters:
      key - the key (must not be null)
      value - the current value (may be null)
      exists - whether the entry exists in the map
      Throws:
      NullPointerException - if key is null
  • Method Details