Class InvocableMapHelper.RoutingMapTriggerEntry

java.lang.Object
com.tangosol.util.InvocableMapHelper.RoutingMapTriggerEntry
All Implemented Interfaces:
InvocableMap.Entry, MapTrigger.Entry, QueryMap.Entry, Map.Entry
Direct Known Subclasses:
InvocableMapHelper.RoutingBinaryEntry
Enclosing class:
InvocableMapHelper

protected static class InvocableMapHelper.RoutingMapTriggerEntry extends Object implements MapTrigger.Entry
MapTrigger.Entry wrapper that routes the getValue() call onto getOriginalValue().
  • Field Details

    • m_entry

      protected InvocableMap.Entry m_entry
      The underlying entry. We artificially widen the type to be able to extend this class.
  • Constructor Details

    • RoutingMapTriggerEntry

      protected RoutingMapTriggerEntry(MapTrigger.Entry entry)
      Construct a routing entry.
      Parameters:
      entry - the underlying MapTrigger.Entry
    • RoutingMapTriggerEntry

      protected RoutingMapTriggerEntry(BinaryEntry entry)
      Construct a routing entry.
      Parameters:
      entry - the underlying BinaryEntry
  • Method Details

    • getKey

      public Object getKey()
      Return the key corresponding to this entry. The resultant key does not necessarily exist within the containing Map, which is to say that InvocableMap.this.containsKey(getKey()) could return false. To test for the presence of this key within the Map, use InvocableMap.Entry.isPresent(), and to create the entry for the key, use InvocableMap.Entry.setValue(V).
      Specified by:
      getKey in interface InvocableMap.Entry
      Specified by:
      getKey in interface Map.Entry
      Returns:
      the key corresponding to this entry; may be null if the underlying Map supports null keys
    • getValue

      public Object getValue()
      Return an OriginalValue from the underlying entry.
      Specified by:
      getValue in interface InvocableMap.Entry
      Specified by:
      getValue in interface Map.Entry
      Returns:
      the value corresponding to this entry; may be null if the value is null or if the Entry does not exist in the Map
    • extract

      public Object extract(ValueExtractor extractor)
      Extract a value out of the Entry's key or value. Calling this method is semantically equivalent to extractor.extract(entry.getValue()), but this method may be significantly less expensive. For example, the resultant value may be obtained from a forward index, avoiding a potential object de-serialization.
      Specified by:
      extract in interface QueryMap.Entry
      Parameters:
      extractor - a ValueExtractor to apply to the Entry's key or value
      Returns:
      the extracted value
    • getOriginalValue

      public Object getOriginalValue()
      Description copied from interface: MapTrigger.Entry
      Determine the value that existed before the start of the mutating operation that is being evaluated by the trigger.
      Specified by:
      getOriginalValue in interface MapTrigger.Entry
      Returns:
      the original value corresponding to this Entry; may be null if the value is null or if the Entry did not exist in the Map
      Throws:
      UnsupportedOperationException
    • setValue

      public Object setValue(Object oValue)
      Description copied from interface: InvocableMap.Entry
      Store the value corresponding to this entry. If the entry does not exist, then the entry will be created by invoking this method, even with a null value (assuming the Map supports null values).
      Specified by:
      setValue in interface InvocableMap.Entry
      Specified by:
      setValue in interface Map.Entry
      Parameters:
      oValue - the new value for this Entry
      Returns:
      the previous value of this Entry, or null if the Entry did not exist
      Throws:
      UnsupportedOperationException
    • setValue

      public void setValue(Object oValue, boolean fSynthetic)
      Description copied from interface: InvocableMap.Entry
      Store the value corresponding to this entry. If the entry does not exist, then the entry will be created by invoking this method, even with a null value (assuming the Map supports null values).

      Unlike the other form of setValue, this form does not return the previous value, and as a result may be significantly less expensive (in terms of cost of execution) for certain Map implementations.

      Specified by:
      setValue in interface InvocableMap.Entry
      Parameters:
      oValue - the new value for this Entry
      fSynthetic - pass true only if the insertion into or modification of the Map should be treated as a synthetic event
      Throws:
      UnsupportedOperationException
    • update

      public void update(ValueUpdater updater, Object oValue)
      Description copied from interface: InvocableMap.Entry
      Update the Entry's value. Calling this method is semantically equivalent to:
         V target = entry.getValue();
         updater.update(target, value);
         entry.setValue(target, false);
       
      The benefit of using this method is that it may allow the Entry implementation to significantly optimize the operation, such as for purposes of delta updates and backup maintenance.
      Specified by:
      update in interface InvocableMap.Entry
      Parameters:
      updater - a ValueUpdater used to modify the Entry's value
      oValue - the new value for this Entry
      Throws:
      UnsupportedOperationException
    • remove

      public void remove(boolean fSynthetic)
      Description copied from interface: InvocableMap.Entry
      Remove this Entry from the Map if it is present in the Map.

      This method supports both the operation corresponding to Map.remove(java.lang.Object) as well as synthetic operations such as eviction. If the containing Map does not differentiate between the two, then this method will always be identical to InvocableMap.this.remove(getKey()).

      Specified by:
      remove in interface InvocableMap.Entry
      Parameters:
      fSynthetic - pass true only if the removal from the Map should be treated as a synthetic event
      Throws:
      UnsupportedOperationException
    • isPresent

      public boolean isPresent()
      Description copied from interface: InvocableMap.Entry
      Determine if this Entry exists in the Map. If the Entry is not present, it can be created by calling InvocableMap.Entry.setValue(Object) or InvocableMap.Entry.setValue(Object, boolean). If the Entry is present, it can be destroyed by calling InvocableMap.Entry.remove(boolean).
      Specified by:
      isPresent in interface InvocableMap.Entry
      Returns:
      true iff this Entry is existent in the containing Map
      Throws:
      UnsupportedOperationException
    • isSynthetic

      public boolean isSynthetic()
      Description copied from interface: InvocableMap.Entry
      Determine if this Entry has been synthetically mutated. This method returns false if either a non-synthetic update was made or the entry has not been modified.
      Specified by:
      isSynthetic in interface InvocableMap.Entry
      Returns:
      true if the Entry has been synthetically mutated
      Throws:
      UnsupportedOperationException
    • isOriginalPresent

      public boolean isOriginalPresent()
      Description copied from interface: MapTrigger.Entry
      Determine whether or not the Entry existed before the start of the mutating operation that is being evaluated by the trigger.
      Specified by:
      isOriginalPresent in interface MapTrigger.Entry
      Returns:
      true iff this Entry was existent in the containing Map
      Throws:
      UnsupportedOperationException