Interface MapEventTransformer<K,​V,​U>

  • All Superinterfaces:
    Serializable
    All Known Implementing Classes:
    ExtractorEventTransformer, MapEventTransformerFilter, SamplingEventTransformer, SemiLiteEventTransformer
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface MapEventTransformer<K,​V,​U>
    extends Serializable
    MapEventTransformer interface is used to allow an event consumer to change the content of a MapEvent destined for the corresponding MapListener.

    In general, the transform method is called after the original MapEvent is evaluated by a Filter (such as MapEventFilter). The values contained by the returned MapEvent object will be the ones given (sent) to the corresponding listener. Returning null will prevent the emission of the event altogether.

    Note: Currently, the MapEventTransformer interface is supported only by partitioned caches.

    Since:
    Coherence 3.4
    Author:
    gg/jh 2008.05.01
    • Method Detail

      • transform

        MapEvent<K,​U> transform​(MapEvent<K,​V> event)
        Transform the specified MapEvent. The values contained by the returned MapEvent object will be the ones given (sent) to the corresponding listener.
        Parameters:
        event - the original MapEvent object
        Returns:
        modified MapEvent object or null to discard the event
      • andThen

        default <T> MapEventTransformer<K,​V,​T> andThen​(MapEventTransformer<K,​U,​T> after)
        Returns a composed MapEventTransformer that performs, in sequence, this transformation followed by the after transformation.

        If performing either transformation throws an exception, it is relayed to the caller of the composed operation. If performing this transformation throws an exception, the after transformation will not be performed.

        Type Parameters:
        T - the resulting transformed type T of the after transformer
        Parameters:
        after - the transformation to perform after this transformation
        Returns:
        a composed MapEventTransformer that performs in sequence this transformation followed by the after transformation