Class Stages.StageChainBuilder<DATA>
- java.lang.Object
-
- org.glassfish.jersey.process.internal.Stages.StageChainBuilder<DATA>
-
- All Implemented Interfaces:
Stage.Builder<DATA>
- Enclosing class:
- Stages
private static class Stages.StageChainBuilder<DATA> extends java.lang.Object implements Stage.Builder<DATA>
-
-
Field Summary
Fields Modifier and Type Field Description private ChainableStage<DATA>
lastStage
private Stage<DATA>
rootStage
private java.util.Deque<java.util.function.Function<DATA,DATA>>
transformations
-
Constructor Summary
Constructors Modifier Constructor Description private
StageChainBuilder(java.util.function.Function<DATA,DATA> transformation)
private
StageChainBuilder(ChainableStage<DATA> rootStage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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(java.util.function.Function<DATA,DATA> transformation)
Add a transformation function as a next stage to the stage chain.Stage.Builder<DATA>
to(ChainableStage<DATA> stage)
Add a newchainable stage
as a next stage to the stage chain.
-
-
-
Constructor Detail
-
StageChainBuilder
private StageChainBuilder(java.util.function.Function<DATA,DATA> transformation)
-
StageChainBuilder
private StageChainBuilder(ChainableStage<DATA> rootStage)
-
-
Method Detail
-
to
public Stage.Builder<DATA> to(java.util.function.Function<DATA,DATA> transformation)
Description copied from interface:Stage.Builder
Add a transformation function as a next stage to the stage chain.The order of the
to(...)
method invocations matches the order of the stage execution at runtime.- Specified by:
to
in interfaceStage.Builder<DATA>
- Parameters:
transformation
- a transformation function to be added as a next stage to the stage chain.- Returns:
- updated builder instance.
-
to
public Stage.Builder<DATA> to(ChainableStage<DATA> stage)
Description copied from interface:Stage.Builder
Add a newchainable 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 ato(...)
method will automatically invoke theChainableStage.setDefaultNext(Stage)
method on the chainable stage.- Specified by:
to
in interfaceStage.Builder<DATA>
- Parameters:
stage
- a chainable stage to be added as a next stage to the stage chain.- Returns:
- updated builder instance.
-
build
public Stage<DATA> build(Stage<DATA> stage)
Description copied from interface:Stage.Builder
Add a terminal stage to the stage chain and build the chain.- Specified by:
build
in interfaceStage.Builder<DATA>
- Parameters:
stage
- last stage to be added to the stage chain.- Returns:
- built stage chain.
-
build
public Stage<DATA> build()
Description copied from interface:Stage.Builder
Build a stage chain.- Specified by:
build
in interfaceStage.Builder<DATA>
- Returns:
- built acceptor chain.
-
-