info.novatec.testit.webtester.conditions.Condition Maven / Gradle / Ivy
package info.novatec.testit.webtester.conditions;
import java.util.function.Predicate;
/**
* A condition is a special form of {@link Predicate}.
*
* It is used in WebTester's API in order to allow for the extension with additional features in the future.
*
* @param the type of the input to the predicate
* @see Predicate
* @see Conditions
* @since 2.0
*/
public interface Condition extends Predicate {
@Override
default Condition negate() {
return (t) -> !test(t);
}
@Override
default Condition and(Predicate other) {
return (t) -> test(t) && other.test(t);
}
@Override
default Condition or(Predicate other) {
return (t) -> test(t) || other.test(t);
}
}