Class Pipeline<T>

java.lang.Object
com.norconex.commons.lang.pipeline.Pipeline<T>
Type Parameters:
T - pipeline context type
All Implemented Interfaces:
IPipelineStage<T>, Predicate<T>

@Deprecated(since="3.0.0") public class Pipeline<T> extends Object implements IPipelineStage<T>
Deprecated.
Use Predicates or Predicate chaining instead
Represent a very simple pipeline container for a list of executable tasks called "pipeline stages" (defined using Predicate). This pipeline class can also be used as a pipeline stage to create pipe hierarchies. Any of the pipeline stages returning false effectively puts an end to the pipeline execution. For more sophisticated workflow needs, consider using a more advanced framework.
Since:
1.5.0
  • Constructor Details

    • Pipeline

      public Pipeline()
      Deprecated.
      Constructor.
    • Pipeline

      public Pipeline(List<IPipelineStage<T>> stages)
      Deprecated.
      Creates a new pipeline with the specified stages.
      Parameters:
      stages - the stages to execute
  • Method Details

    • getStages

      public List<IPipelineStage<T>> getStages()
      Deprecated.
      Gets the pipeline stages.
      Returns:
      the pipeline stages
    • addStages

      public Pipeline<T> addStages(List<IPipelineStage<T>> stages)
      Deprecated.
      Adds stages to the pipeline.
      Parameters:
      stages - pipeline stages to add
      Returns:
      this instance, for chaining
    • addStage

      public Pipeline<T> addStage(IPipelineStage<T> stage)
      Deprecated.
      Adds a stage to the pipeline.
      Parameters:
      stage - pipeline stage to add
      Returns:
      this instance, for chaining
    • clearStages

      public void clearStages()
      Deprecated.
    • execute

      public boolean execute(T context)
      Deprecated.
      Description copied from interface: IPipelineStage
      Executes this pipeline stage. Implementors are encouraged to throw PipelineException upon errors.
      Specified by:
      execute in interface IPipelineStage<T>
      Parameters:
      context - pipeline context
      Returns:
      whether to continue pipeline execution or stop (true to continue).