private static class Stages.StageChainBuilder<DATA> extends java.lang.Object implements Stage.Builder<DATA>
Modifier and Type | Field and Description |
---|---|
private ChainableStage<DATA> |
lastStage |
private Stage<DATA> |
rootStage |
private java.util.Deque<com.google.common.base.Function<DATA,DATA>> |
transformations |
Modifier | Constructor and Description |
---|---|
private |
StageChainBuilder(ChainableStage<DATA> rootStage) |
private |
StageChainBuilder(com.google.common.base.Function<DATA,DATA> transformation) |
Modifier and Type | Method and Description |
---|---|
private void |
addTailStage(Stage<DATA> lastStage) |
Stage<DATA> |
build()
Build a stage chain.
|
Stage<DATA> |
build(Stage<DATA> stage)
Add a terminal stage to the stage chain and build the chain.
|
private Stage<DATA> |
convertTransformations(Stage<DATA> successor) |
Stage.Builder<DATA> |
to(ChainableStage<DATA> stage)
Add a new
chainable stage as a next stage to the
stage chain. |
Stage.Builder<DATA> |
to(com.google.common.base.Function<DATA,DATA> transformation)
Add a transformation function as a next stage to the stage chain.
|
private final java.util.Deque<com.google.common.base.Function<DATA,DATA>> transformations
private ChainableStage<DATA> lastStage
private StageChainBuilder(com.google.common.base.Function<DATA,DATA> transformation)
private StageChainBuilder(ChainableStage<DATA> rootStage)
public Stage.Builder<DATA> to(com.google.common.base.Function<DATA,DATA> transformation)
Stage.Builder
The order of the to(...)
method invocations matches the order
of the stage execution at runtime.
to
in interface Stage.Builder<DATA>
transformation
- a transformation function to be added as a next
stage to the stage chain.public Stage.Builder<DATA> to(ChainableStage<DATA> stage)
Stage.Builder
chainable stage
as a next stage to the
stage chain.
The order of the to(...)
method invocations matches the order
of the stage execution at runtime.
A subsequent call to a to(...)
method will automatically invoke the
ChainableStage.setDefaultNext(Stage)
method on the chainable
stage.
to
in interface Stage.Builder<DATA>
stage
- a chainable stage to be added as a next
stage to the stage chain.public Stage<DATA> build(Stage<DATA> stage)
Stage.Builder
build
in interface Stage.Builder<DATA>
stage
- last stage to be added to the stage chain.public Stage<DATA> build()
Stage.Builder
build
in interface Stage.Builder<DATA>