Interface FilterWrapper<T>

Type Parameters:
T -
All Superinterfaces:
Stateful<T>, Test, Wrapper<T>
All Known Implementing Classes:
AbstractFilterWrapper, BooleanEitherFilter, BooleanFilter, BooleanMatchFilter, DefaultNumberWrapper, DefaultNumberWrapper.DefaultDoubleWrapper, DefaultNumberWrapper.DefaultIntWrapper, DefaultNumberWrapper.DefaultLongWrapper, TestFilter

public interface FilterWrapper<T>
extends Wrapper<T>, Test
A wrapper around a node that is created as the result of a filtering operation.
Author:
Greg Higgins [email protected]
  • Method Details

    • elseStream

      default Wrapper<T> elseStream()
      provides an else branch to a filter node in this stream.
      Returns:
      A wrapper on the else branch of a filtering operation
    • notifyOnChange

      default FilterWrapper<T> notifyOnChange​(boolean notifyOnChange)
      Description copied from interface: Wrapper
      Controls the notification policy of event notification to child nodes for this stream node. The default policy is to invoke child nodes when the return of the parent event method is true. NotifyOnChange notifies the child only when the parent node return of the previous cycle is false and this one is true.

      This can be useful if a single notification of a breach is required and subsequent continued breaches are swallowed, for example this can prevent logging spamming when combined with filters.

      Specified by:
      notifyOnChange in interface Wrapper<T>
      Parameters:
      notifyOnChange - false = notify always. true = notify on change only
      Returns:
      The current node
    • push

      default <R,​ S extends R> FilterWrapper<T> push​(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,​S> supplier, com.fluxtion.api.partition.LambdaReflection.SerializableConsumer<R> mapper)
      Description copied from interface: Wrapper
      pushes a data item from the current node in the stream to any node.The target node will become part of the same execution graph as the source.

      The returned node is the current node in the stream.

      Specified by:
      push in interface Wrapper<T>
      Returns:
      the com.fluxtion.ext.declarative.api.Wrapper
    • forEach

      default FilterWrapper<T> forEach​(com.fluxtion.api.partition.LambdaReflection.SerializableConsumer<T> consumer)
      Description copied from interface: Wrapper
      Registers a Consumer to operate on the current node when an event wave is passing through this node. The consumer can perform any operation on the node including mutations. This node, possibly mutated, is passed as a reference to child nodes. No new nodes are created in the stream as a side-effect of this processing.
      Specified by:
      forEach in interface Wrapper<T>
      Parameters:
      consumer - Consumer of this node
      Returns:
      The current node
    • forEach

      default FilterWrapper<T> forEach​(com.fluxtion.api.partition.LambdaReflection.SerializableConsumer<T> consumer, java.lang.String consumerId)
      Specified by:
      forEach in interface Wrapper<T>
    • validOnStart

      default FilterWrapper<T> validOnStart​(boolean alwaysReset)
      Description copied from interface: Wrapper
      Set this property to signal the wrapper has a valid value and child nodes do not have to wait for a trigger notification before using the data from this instance.
      Specified by:
      validOnStart in interface Wrapper<T>
      Returns:
    • id

      default FilterWrapper<T> id​(java.lang.String id)
      Description copied from interface: Wrapper
      Set the node id for this node within the generated SEP. This is the variable name of the node in a Java SEP. The id must be unique for the SEP.
      Specified by:
      id in interface Wrapper<T>
      Parameters:
      id - the unique id of the node in the SEP
      Returns:
      The current node