Package org.jline.shell
Interface Pipeline
- All Known Implementing Classes:
DefaultPipeline
public interface Pipeline
Represents a pipeline of commands connected by operators such as pipes,
redirections, and conditional connectors.
A pipeline is built by chaining commands with operators:
Pipeline pipeline = Pipeline.of("ls")
.pipe("grep pattern") // |
.redirect(Path.of("out")) // > out
.build();
Pipelines are immutable once built. Use of(String) to start
building a pipeline.
- Since:
- 4.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumOperators that connect commands in a pipeline.static interfaceA single stage in a pipeline, consisting of a command line and the operator that follows it. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether this pipeline should execute in the background.static PipelineBuilderStarts building a new pipeline with the given command.source()Returns the original command line string that was parsed to create this pipeline.stages()Returns the ordered list of stages in this pipeline.
-
Method Details
-
stages
List<Pipeline.Stage> stages()Returns the ordered list of stages in this pipeline.- Returns:
- the stages
-
source
String source()Returns the original command line string that was parsed to create this pipeline.- Returns:
- the source command line
-
isBackground
boolean isBackground()Returns whether this pipeline should execute in the background.- Returns:
- true if background execution was requested
-
of
Starts building a new pipeline with the given command.- Parameters:
command- the first command in the pipeline- Returns:
- a new pipeline builder
-