vertx.effect.exp.Quadruple Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vertx-effect Show documentation
Show all versions of vertx-effect Show documentation
When actors meet Functional Programming
package vertx.effect.exp;
import io.vavr.Tuple4;
import vertx.effect.Val;
import vertx.effect.core.AbstractVal;
import static java.util.Objects.requireNonNull;
public abstract class Quadruple extends AbstractVal> {
public static Quadruple parallel(final Val _1,
final Val _2,
final Val _3,
final Val _4) {
return new ParallelQuadruple<>(requireNonNull(_1),
requireNonNull(_2),
requireNonNull(_3),
requireNonNull(_4)
);
}
public static Quadruple sequential(final Val _1,
final Val _2,
final Val _3,
final Val _4) {
return new SequentialQuadruple<>(requireNonNull(_1),
requireNonNull(_2),
requireNonNull(_3),
requireNonNull(_4)
);
}
public abstract Val _1();
public abstract Val _2();
public abstract Val _3();
public abstract Val _4();
public static Val race(final Quadruple quadruple) {
if (quadruple == null)
return Cons.failure(new IllegalArgumentException("Quadruple.race: pair is null"));
return ListExp.parallel(quadruple._1(),
quadruple._2(),
quadruple._3(),
quadruple._4()
)
.race();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy