fr.vergne.pester.factory.RestartCondition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pester-core Show documentation
Show all versions of pester-core Show documentation
Implementation of the Pester library.
The newest version!
package fr.vergne.pester.factory;
import java.util.function.Predicate;
interface RestartCondition extends Predicate {
public static RestartCondition noRestart() {
return x -> false;
}
public static > RestartCondition range(T minInclusive, T maxExclusive) {
return x -> x.compareTo(minInclusive) < 0 || x.compareTo(maxExclusive) >= 0;
}
public static RestartCondition oneDigitRange() {
RestartCondition range = range((byte) 0, (byte) 10);
return n -> range.test(n.byteValue());
}
}