public class Pipeline<T,P extends Pipeline<T,P>>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.function.Function<io.vavr.collection.List<T>,P> |
pipelineFactory |
protected io.vavr.collection.List<T> |
population |
Modifier | Constructor and Description |
---|---|
protected |
Pipeline(io.vavr.collection.List<T> population,
java.util.function.Function<io.vavr.collection.List<T>,P> pipelineFactory) |
Modifier and Type | Method and Description |
---|---|
io.vavr.collection.List<T> |
extract()
Extracts the current population from the pipeline.
|
P |
mergeWith(P otherPipeline)
Merges this pipeline with the provided one omitting any repetitions (it behaves as set).
|
io.vavr.Tuple2<P,P> |
split(java.util.function.Predicate<? super T> predicate)
Splits this pipeline according to the provided predicate.
|
protected final io.vavr.collection.List<T> population
public final io.vavr.Tuple2<P,P> split(java.util.function.Predicate<? super T> predicate)
Splits this pipeline according to the provided predicate.
Elements matching predicate are in the first element (Tuple2._1
) and the rest in the second one (Tuple2._2
).
predicate
- a predicate to grade the population.public final P mergeWith(P otherPipeline)
Merges this pipeline with the provided one omitting any repetitions (it behaves as set).
otherPipeline
- a pipeline of the same type.public final io.vavr.collection.List<T> extract()
Extracts the current population from the pipeline.