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

fr.vergne.pester.factory.RestartCondition Maven / Gradle / Ivy

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());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy