Class ChainBuilder<I,O>
java.lang.Object
ca.mcscert.jpipe.compiler.model.ChainBuilder<I,O>
- Type Parameters:
I- input type of the chain (type produced by theSource).O- current output type (changes with eachandThencall).
Fluent builder that accumulates
Transformations into a compilation
chain. Call andThen(Transformation) to append steps; finalise with
andThen(Sink) to produce a ChainCompiler.-
Method Summary
Modifier and TypeMethodDescriptionFinalise the chain by attaching a sink, producing a ready-to-useCompiler.<R> ChainBuilder<I, R> andThen(Transformation<O, R> next) Append a transformation to the end of the current chain.Expose the accumulated chain as a plainTransformation, useful when the chain is embedded inside a larger pipeline rather than used standalone.
-
Method Details
-
andThen
Append a transformation to the end of the current chain.- Type Parameters:
R- new output type.- Parameters:
next- the step to add.- Returns:
- a new builder with the extended chain.
-
andThen
Finalise the chain by attaching a sink, producing a ready-to-useCompiler.- Parameters:
sink- the final serialisation step.- Returns:
- a complete
ChainCompiler.
-
asTransformation
Expose the accumulated chain as a plainTransformation, useful when the chain is embedded inside a larger pipeline rather than used standalone.- Returns:
- the composed transformation.
-