Class AbstractUpdater<K,​V,​U>

  • All Implemented Interfaces:
    ValueUpdater<Object,​U>, Serializable
    Direct Known Subclasses:
    MvelUpdater, PofUpdater, ReflectionUpdater, UniversalUpdater

    public abstract class AbstractUpdater<K,​V,​U>
    extends ExternalizableHelper
    implements ValueUpdater<Object,​U>, Serializable
    Abstract base for ValueUpdater implementations.

    Starting with Coherence 3.6, when used to update information stored in a Map, subclasses have the additional ability to operate against the Map.Entry instead of just the value. This allows an updater implementation to update a desired value using all available information on the corresponding Map.Entry object and is intended to be used in advanced custom scenarios, when application code needs to look at both key and value at the same time or can make some very specific assumptions regarding to the implementation details of the underlying Entry object (e.g. BinaryEntry). To maintain full backwards compatibility, the default behavior remains to update the Value property of the Map.Entry.

    Note: subclasses are responsible for POF and/or Lite serialization of the updater.

    Since:
    Coherence 3.6
    Author:
    gg 2009.09.11
    See Also:
    Serialized Form
    • Constructor Detail

      • AbstractUpdater

        public AbstractUpdater()
    • Method Detail

      • update

        public void update​(Object oTarget,
                           U oValue)
        Update the state of the passed target object using the passed value. For intrinsic types, the specified value is expected to be a standard wrapper type in the same manner that reflection works; for example, an int value would be passed as a java.lang.Integer.
        Specified by:
        update in interface ValueUpdater<K,​V>
        Parameters:
        oTarget - the Object to update the state of
        oValue - the new value to update the state with
      • updateEntry

        public void updateEntry​(Map.Entry<K,​V> entry,
                                U oValue)
        Update the state of the passed entry using the passed value.

        By overriding this method, an updater implementation is able to update the entry's value using all available information on the corresponding Map.Entry object and is intended to be used in advanced custom scenarios, when application code needs to look at both key and value at the same time or can make some very specific assumptions regarding to the implementation details of the underlying Entry object.

        Parameters:
        entry - the Entry object whose value is to be updated
        oValue - the new value to update the entry with; for intrinsic types, the specified value is expected to be a standard wrapper type in the same manner that reflection works (e.g. an int value would be passed as a java.lang.Integer)