T - public interface Wrapper<T>
Stream operations are provided to filter and map the underlying wrapped type.
| Modifier and Type | Method and Description |
|---|---|
default Wrapper<T> |
alwaysReset(boolean alwaysReset)
Reset a stateful node after every execution cycle, without the need for a
an external
resetNotifier(java.lang.Object). |
default <S> Wrapper<T> |
console(String prefix,
com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,S>... supplier)
dump this node to console, prefixed with the supplied message.
Object.toString() will be invoked on the node instance. |
T |
event()
The wrapped node
|
Class<T> |
eventClass()
The type of the wrapped node
|
default FilterWrapper<T> |
filter(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,Boolean> filter) |
default <S> FilterWrapper<T> |
filter(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,S> supplier,
com.fluxtion.api.partition.LambdaReflection.SerializableFunction<S,Boolean> filter) |
default Wrapper<T> |
forEach(com.fluxtion.api.partition.LambdaReflection.SerializableConsumer<T> consumer)
Registers a
Consumer to operate on the current node when an event
wave is passing through this node. |
default Wrapper<T> |
forEach(com.fluxtion.api.partition.LambdaReflection.SerializableConsumer<T> consumer,
String consumerId) |
default Wrapper<T> |
id(String id)
Set the node id for this node within the generated SEP.
|
default Wrapper<T> |
immediateReset(boolean immediateReset)
Controls reset timing policy for stateful nodes.
|
default <R,S> Wrapper<R> |
map(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<S,R> mapper,
com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,S> supplier)
Maps a value using the provided mapping function.
|
default <R> Wrapper<R> |
map(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,R> mapper)
Maps a value using the provided mapping function.
|
default <R> Wrapper<R> |
mapDouble(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<? extends Double,R> mapper)
Invokes a mapping function that accepts a
Double as an input |
default <R> Wrapper<R> |
mapInt(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<? extends Integer,R> mapper)
Invokes a mapping function that accepts a
Integer as an input |
default <R> Wrapper<R> |
mapLong(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<? extends Long,R> mapper)
Invokes a mapping function that accepts a
Long as an input |
default Wrapper<T> |
notiferMerge(Object eventNotifier)
Attaches an event notification instance to the current stream node.
|
default Wrapper<T> |
notifierOverride(Object eventNotifier)
Attaches an event notification instance to the current stream node,
overriding the execution path of the current stream.
|
default Wrapper<T> |
notifyOnChange(boolean notifyOnChange)
Controls the notification policy of event notification to child nodes for
this stream node.
|
default Wrapper<T> |
publishAndReset(Object notifier)
resets the stateful node and publishes the current value.
|
default <T,R,S extends R> |
push(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,S> supplier,
com.fluxtion.api.partition.LambdaReflection.SerializableConsumer<R> mapper)
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.
|
default Wrapper<T> |
resetNotifier(Object resetNotifier)
Attaches a reset notifier instance to the current stream node.
|
static final LongAdder counter
T event()
default FilterWrapper<T> filter(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,Boolean> filter)
default <S> FilterWrapper<T> filter(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,S> supplier, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<S,Boolean> filter)
default <R> Wrapper<R> map(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,R> mapper)
Wrapper.R - The return type of the mapping functionmapper - the mapping functiondefault <R> Wrapper<R> mapDouble(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<? extends Double,R> mapper)
Double as an inputR - The return type of the mapping functionmapper - the mapping functiondefault <R> Wrapper<R> mapInt(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<? extends Integer,R> mapper)
Integer as an inputR - The return type of the mapping functionmapper - the mapping functiondefault <R> Wrapper<R> mapLong(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<? extends Long,R> mapper)
Long as an inputR - The return type of the mapping functionmapper - the mapping functiondefault <R,S> Wrapper<R> map(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<S,R> mapper, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,S> supplier)
R - The return type of the mapping functionS - The input type required by the mapping functionmapper - the mapping functionsupplier - default <T,R,S extends R> Wrapper<T> push(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,S> supplier, com.fluxtion.api.partition.LambdaReflection.SerializableConsumer<R> mapper)
The returned node is the current node in the stream.
T - R - S - supplier - mapper - default Wrapper<T> forEach(com.fluxtion.api.partition.LambdaReflection.SerializableConsumer<T> consumer)
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.consumer - Consumer of this nodedefault Wrapper<T> forEach(com.fluxtion.api.partition.LambdaReflection.SerializableConsumer<T> consumer, String consumerId)
default <S> Wrapper<T> console(String prefix, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,S>... supplier)
Object.toString() will be invoked on the node instance.S - prefix - String prefix for the console messagesupplier - default Wrapper<T> resetNotifier(Object resetNotifier)
Stateful it may be desirable to reset its state under
controlled conditions. When the resetNotifier is on an execution path it
will invoke the reset method of this node if it is StatefulresetNotifier - external notifierdefault Wrapper<T> notiferMerge(Object eventNotifier)
eventNotifier - external event notifierdefault Wrapper<T> notifierOverride(Object eventNotifier)
eventNotifier - external event notifierdefault Wrapper<T> publishAndReset(Object notifier)
immediateReset(boolean)
with value of false.notifier - default Wrapper<T> notifyOnChange(boolean notifyOnChange)
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.
notifyOnChange - false = notify always. true = notify on change onlydefault Wrapper<T> immediateReset(boolean immediateReset)
resetNotifier(java.lang.Object) or alwaysReset(boolean). The timing policy has the following
behaviour:
immediateReset - reset timing policydefault Wrapper<T> alwaysReset(boolean alwaysReset)
resetNotifier(java.lang.Object).
resetNotifier(java.lang.Object)
alwaysReset - - reset policy for stateful nodesCopyright © 2019. All rights reserved.