All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.g2forge.alexandria.java.function.IPredicate2 Maven / Gradle / Ivy

There is a newer version: 0.0.18
Show newest version
package com.g2forge.alexandria.java.function;

import java.util.Objects;
import java.util.function.BiPredicate;
import java.util.function.Supplier;

@FunctionalInterface
public interface IPredicate2 extends BiPredicate, IPredicate {
	public static  IPredicate2 create(boolean value) {
		return (i0, i1) -> value;
	}

	public static  IPredicate2 create(IPredicate2 predicate) {
		return predicate;
	}

	public default IPredicate1 compose0(Supplier before) {
		Objects.requireNonNull(before);
		return i1 -> test(before.get(), i1);
	}

	public default IPredicate1 compose1(Supplier before) {
		Objects.requireNonNull(before);
		return i0 -> test(i0, before.get());
	}

	public default IPredicate1 curry0(I0 input0) {
		return input1 -> test(input0, input1);
	}

	public default IPredicate1 curry1(I1 input1) {
		return input0 -> test(input0, input1);
	}

	public default IConsumer2 noReturn() {
		return (i0, i1) -> test(i0, i1);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy