AbstractPipeline

abstract class AbstractPipeline<Output : Any>(val context: <Error class: unknown class>, val chain: PipelineChainLink) : Pipeline<Output> (source)

Helper class to implement Pipeline.

Notes for implementors

When implementing a new type of pipeline, the main requirement is to override the return tpe of all existing stage methods to return the same type as the current instance. This sadly has to be done manually because Kotlin doesn't have self-types.

When overriding the stage methods, avoid doing anything other than down-casting the resulting pipeline.

You will also need to implement withStage. Note how creating an instance of AbstractPipeline requires passing a PipelineChainLink. PipelineChainLink implements all complex methods from Pipeline for you.

Constructors

Link copied to clipboard
constructor(context: <Error class: unknown class>, chain: PipelineChainLink)

Properties

Link copied to clipboard

Internal representation of the pipeline state.

Link copied to clipboard
open override val context: <Error class: unknown class>

The context used to generate this pipeline.

Functions

Link copied to clipboard
abstract fun <New : Any> reinterpret(): Pipeline<New>

Changes the type of the returned document, with no type-safety.

Link copied to clipboard
override fun toString(): String

JSON representation of this pipeline.

Link copied to clipboard
abstract override fun withStage(stage: BsonNode): Pipeline<Output>

Creates a new pipeline that expands on the current one by adding stage.

Link copied to clipboard
override fun writeTo(writer: <Error class: unknown class>)

Writes the entire pipeline into writer.