Package org.apache.kafka.streams.kstream
Class Branched<K,V>
java.lang.Object
org.apache.kafka.streams.kstream.Branched<K,V>
- Type Parameters:
K- type of record keyV- type of record value
The
Branched class is used to define the optional parameters when building branches with
BranchedKStream.-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> Branched <K, V> Create an instance ofBranchedwith provided branch name suffix.static <K,V> Branched <K, V> withConsumer(Consumer<? super KStream<K, V>> chain, String name) Create an instance ofBranchedwith provided chain consumer and branch name suffix.static <K,V> Branched <K, V> withConsumer(Consumer<KStream<K, V>> chain) Create an instance ofBranchedwith provided chain consumer.static <K,V> Branched <K, V> withFunction(Function<? super KStream<K, V>, ? extends KStream<K, V>> chain) Create an instance ofBranchedwith provided chain function.static <K,V> Branched <K, V> withFunction(Function<? super KStream<K, V>, ? extends KStream<K, V>> chain, String name) Create an instance ofBranchedwith provided chain function and branch name suffix.Configure the instance ofBranchedwith a branch name suffix.
-
Method Details
-
as
Create an instance ofBranchedwith provided branch name suffix.- Type Parameters:
K- key typeV- value type- Parameters:
name- the branch name suffix to be used (seeBranchedKStreamdescription for details)- Returns:
- a new instance of
Branched
-
withFunction
public static <K,V> Branched<K,V> withFunction(Function<? super KStream<K, V>, ? extends KStream<K, V>> chain) Create an instance ofBranchedwith provided chain function.- Type Parameters:
K- key typeV- value type- Parameters:
chain- A function that will be applied to the branch. If the provided function returnsnull, its result is ignored, otherwise it is added to theMapreturned byBranchedKStream.defaultBranch()orBranchedKStream.noDefaultBranch()(seeBranchedKStreamdescription for details).- Returns:
- a new instance of
Branched
-
withConsumer
Create an instance ofBranchedwith provided chain consumer.- Type Parameters:
K- key typeV- value type- Parameters:
chain- A consumer to which the branch will be sent. If a consumer is provided, the respective branch will not be added to the resultingMapreturned byBranchedKStream.defaultBranch()orBranchedKStream.noDefaultBranch()(seeBranchedKStreamdescription for details).- Returns:
- a new instance of
Branched
-
withFunction
public static <K,V> Branched<K,V> withFunction(Function<? super KStream<K, V>, ? extends KStream<K, V>> chain, String name) Create an instance ofBranchedwith provided chain function and branch name suffix.- Type Parameters:
K- key typeV- value type- Parameters:
chain- A function that will be applied to the branch. If the provided function returnsnull, its result is ignored, otherwise it is added to theMapreturned byBranchedKStream.defaultBranch()orBranchedKStream.noDefaultBranch()(seeBranchedKStreamdescription for details).name- the branch name suffix to be used. Ifnull, a default branch name suffix will be generated (seeBranchedKStreamdescription for details)- Returns:
- a new instance of
Branched
-
withConsumer
Create an instance ofBranchedwith provided chain consumer and branch name suffix.- Type Parameters:
K- key typeV- value type- Parameters:
chain- A consumer to which the branch will be sent. If a non-null consumer is provided, the respective branch will not be added to the resultingMapreturned byBranchedKStream.defaultBranch()orBranchedKStream.noDefaultBranch()(seeBranchedKStreamdescription for details).name- the branch name suffix to be used. Ifnull, a default branch name suffix will be generated (seeBranchedKStreamdescription for details)- Returns:
- a new instance of
Branched
-
withName
Configure the instance ofBranchedwith a branch name suffix.- Parameters:
name- the branch name suffix to be used. Ifnulla default branch name suffix will be generated (seeBranchedKStreamdescription for details)- Returns:
thisto facilitate method chaining
-