mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 08:50:57 +07:00
12 lines
325 B
Java
12 lines
325 B
Java
import java.util.function.Consumer;
|
|
class Pipeline<I, O> implements Consumer<I> {
|
|
@Override public final void accept(I input) {}
|
|
|
|
public <K> void then(Pipeline<O, K> pipeline, final Observable<O> observable) {
|
|
observable.subscribe(pipeline::accept);
|
|
}
|
|
}
|
|
|
|
interface Observable<T> {
|
|
void subscribe(Consumer<T> x);
|
|
} |