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
.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
V> Branched<K, V> Create an instance ofBranched
with provided branch name suffix.static <K,
V> Branched<K, V> withConsumer
(Consumer<? super KStream<K, V>> chain, String name) Create an instance ofBranched
with provided chain consumer and branch name suffix.static <K,
V> Branched<K, V> withConsumer
(Consumer<KStream<K, V>> chain) Create an instance ofBranched
with provided chain consumer.static <K,
V> Branched<K, V> withFunction
(Function<? super KStream<K, V>, ? extends KStream<K, V>> chain) Create an instance ofBranched
with 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 ofBranched
with provided chain function and branch name suffix.Configure the instance ofBranched
with a branch name suffix.
-
Field Details
-
name
-
chainFunction
-
chainConsumer
-
-
Constructor Details
-
Branched
-
Branched
-
-
Method Details
-
as
Create an instance ofBranched
with provided branch name suffix.- Type Parameters:
K
- key typeV
- value type- Parameters:
name
- the branch name suffix to be used (seeBranchedKStream
description 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 ofBranched
with 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 theMap
returned byBranchedKStream.defaultBranch()
orBranchedKStream.noDefaultBranch()
(seeBranchedKStream
description for details).- Returns:
- a new instance of
Branched
-
withConsumer
Create an instance ofBranched
with 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 resultingMap
returned byBranchedKStream.defaultBranch()
orBranchedKStream.noDefaultBranch()
(seeBranchedKStream
description 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 ofBranched
with 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 theMap
returned byBranchedKStream.defaultBranch()
orBranchedKStream.noDefaultBranch()
(seeBranchedKStream
description for details).name
- the branch name suffix to be used. Ifnull
, a default branch name suffix will be generated (seeBranchedKStream
description for details)- Returns:
- a new instance of
Branched
-
withConsumer
Create an instance ofBranched
with 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 resultingMap
returned byBranchedKStream.defaultBranch()
orBranchedKStream.noDefaultBranch()
(seeBranchedKStream
description for details).name
- the branch name suffix to be used. Ifnull
, a default branch name suffix will be generated (seeBranchedKStream
description for details)- Returns:
- a new instance of
Branched
-
withName
Configure the instance ofBranched
with a branch name suffix.- Parameters:
name
- the branch name suffix to be used. Ifnull
a default branch name suffix will be generated (seeBranchedKStream
description for details)- Returns:
this
to facilitate method chaining
-