Class DefaultPipeline

java.lang.Object
org.jline.shell.impl.DefaultPipeline
All Implemented Interfaces:
Pipeline

public class DefaultPipeline extends Object implements Pipeline
Default implementation of Pipeline.

A pipeline is an ordered list of Pipeline.Stages connected by Pipeline.Operators. Instances are immutable and created via Pipeline.of(String) or PipelineParser.parse(String).

Since:
4.0
  • Constructor Details

    • DefaultPipeline

      public DefaultPipeline(List<Pipeline.Stage> stages, String source, boolean background)
      Creates a new pipeline.
      Parameters:
      stages - the ordered stages
      source - the original command line
      background - whether to execute in background
  • Method Details

    • stages

      public List<Pipeline.Stage> stages()
      Description copied from interface: Pipeline
      Returns the ordered list of stages in this pipeline.
      Specified by:
      stages in interface Pipeline
      Returns:
      the stages
    • source

      public String source()
      Description copied from interface: Pipeline
      Returns the original command line string that was parsed to create this pipeline.
      Specified by:
      source in interface Pipeline
      Returns:
      the source command line
    • isBackground

      public boolean isBackground()
      Description copied from interface: Pipeline
      Returns whether this pipeline should execute in the background.
      Specified by:
      isBackground in interface Pipeline
      Returns:
      true if background execution was requested
    • toString

      public String toString()
      Overrides:
      toString in class Object