Class 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 Detail

      • transformations

        private final java.util.Deque<java.util.function.Function<DATA,​DATA>> transformations
    • Constructor Detail

      • StageChainBuilder

        private StageChainBuilder​(java.util.function.Function<DATA,​DATA> transformation)
    • 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 interface Stage.Builder<DATA>
        Parameters:
        transformation - a transformation function to be added as a next stage to the stage chain.
        Returns:
        updated builder instance.
      • addTailStage

        private void addTailStage​(Stage<DATA> lastStage)
      • 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 interface Stage.Builder<DATA>
        Parameters:
        stage - last stage to be added to the stage chain.
        Returns:
        built stage chain.
      • convertTransformations

        private Stage<DATA> convertTransformations​(Stage<DATA> successor)