org.apache.geode.cache.util

## Class TxEventTestUtil

- java.lang.Object
- - org.apache.geode.cache.util.TxEventTestUtil

-     public class TxEventTestUtil
      extends java.lang.Object

  Utility class for getting Transaction events for create, invalidate, put, destroy operations.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TxEventTestUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <K,V> java.util.List<EntryEvent<K,V>>` | `getCreateEvents(java.util.List<CacheEvent<K,V>> cacheEvents)` Selects entry create events from a list of cache events.
    `static <K,V> java.util.List<EntryEvent<K,V>>` | `getDestroyEvents(java.util.List<CacheEvent<K,V>> cacheEvents)` Selects the entry destroy events from a list of cache events.
    `static <K,V> java.util.List<EntryEvent<K,V>>` | `getEntryEventsMatching(java.util.List<CacheEvent<K,V>> cacheEvents, java.util.function.Predicate<? super EntryEvent<K,V>> predicate)` Selects the entry events that match the given predicate.
    `static <K,V> java.util.List<EntryEvent<K,V>>` | `getEntryEventsWithOperation(java.util.List<CacheEvent<K,V>> cacheEvents, java.util.function.Predicate<Operation> operationPredicate)` Selects the entry events whose operation matches the given predicate.
    `static <K,V> java.util.List<EntryEvent<K,V>>` | `getInvalidateEvents(java.util.List<CacheEvent<K,V>> cacheEvents)` Selects the entry invalidate events from a list of cache events.
    `static <K,V> java.util.List<EntryEvent<K,V>>` | `getPutEvents(java.util.List<CacheEvent<K,V>> cacheEvents)` Selects the entry update events from a list of cache events.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TxEventTestUtil

          public TxEventTestUtil()

  - ### Method Detail

    - #### getCreateEvents

          public static <K,V> java.util.List<EntryEvent<K,V>> getCreateEvents(java.util.List<CacheEvent<K,V>> cacheEvents)

      Selects entry create events from a list of cache events.
      Returns:
        list of entry create events from the given cache events

    - #### getPutEvents

          public static <K,V> java.util.List<EntryEvent<K,V>> getPutEvents(java.util.List<CacheEvent<K,V>> cacheEvents)

      Selects the entry update events from a list of cache events.
      Returns:
        list of entry update events from the given cache events

    - #### getInvalidateEvents

          public static <K,V> java.util.List<EntryEvent<K,V>> getInvalidateEvents(java.util.List<CacheEvent<K,V>> cacheEvents)

      Selects the entry invalidate events from a list of cache events.
      Returns:
        list of entry invalidate events from the given cache events

    - #### getDestroyEvents

          public static <K,V> java.util.List<EntryEvent<K,V>> getDestroyEvents(java.util.List<CacheEvent<K,V>> cacheEvents)

      Selects the entry destroy events from a list of cache events.
      Returns:
        list of entry destroy events from the given cache events

    - #### getEntryEventsWithOperation

          public static <K,V> java.util.List<EntryEvent<K,V>> getEntryEventsWithOperation(java.util.List<CacheEvent<K,V>> cacheEvents,
                                                                                          java.util.function.Predicate<Operation> operationPredicate)

      Selects the entry events whose operation matches the given predicate.
      Parameters:
        `cacheEvents` - the cache events from which to select entry events
        `operationPredicate` - tests each event's operation to determine whether to include the event
      Returns:
        list of entry events whose operations match the given predicate
      Throws:
        `java.lang.ClassCastException` - if the predicate matches the operation of an event that is not an `EntryEvent`

    - #### getEntryEventsMatching

          public static <K,V> java.util.List<EntryEvent<K,V>> getEntryEventsMatching(java.util.List<CacheEvent<K,V>> cacheEvents,
                                                                                     java.util.function.Predicate<? super EntryEvent<K,V>> predicate)

      Selects the entry events that match the given predicate.
      Parameters:
        `cacheEvents` - the cache events from which to select entry events
        `predicate` - tests whether to include each event
      Returns:
        list of entry events that match the predicate
      Throws:
        `java.lang.ClassCastException` - if the predicate matches an event that is not an `EntryEvent`