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>lastStageprivate Stage<DATA>rootStageprivate java.util.Deque<java.util.function.Function<DATA,DATA>>transformations
-
Constructor Summary
Constructors Modifier Constructor Description privateStageChainBuilder(java.util.function.Function<DATA,DATA> transformation)privateStageChainBuilder(ChainableStage<DATA> rootStage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddTailStage(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 stageas 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.BuilderAdd 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:
toin 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.BuilderAdd a newchainable stageas 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:
toin 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.BuilderAdd a terminal stage to the stage chain and build the chain.- Specified by:
buildin 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.BuilderBuild a stage chain.- Specified by:
buildin interfaceStage.Builder<DATA>- Returns:
- built acceptor chain.
-
-