Interface BundleTrigger<T>

Type Parameters:
T - The input element type.
All Superinterfaces:
Serializable
All Known Implementing Classes:
CountBundleTrigger

@Internal public interface BundleTrigger<T> extends Serializable
A BundleTrigger determines when a bundle of input elements should be evaluated and trigger the callback which registered previously.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    onElement(T element)
    Called for every element that gets added to the bundle.
    void
    Register a callback which will be called once this trigger decides to finish this bundle.
    void
    Reset the trigger to its initiate status.
  • Method Details

    • registerCallback

      void registerCallback(BundleTriggerCallback callback)
      Register a callback which will be called once this trigger decides to finish this bundle.
    • onElement

      void onElement(T element) throws Exception
      Called for every element that gets added to the bundle. If the trigger decides to start evaluate the input, BundleTriggerCallback.finishBundle() should be invoked.
      Parameters:
      element - The element that arrived.
      Throws:
      Exception
    • reset

      void reset()
      Reset the trigger to its initiate status.
    • explain

      String explain()