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

io.github.bhowell2.apilib.checks.BooleanChecks Maven / Gradle / Ivy

package io.github.bhowell2.apilib.checks;

/**
 * @author Blake Howell
 */
public final class BooleanChecks {

	private BooleanChecks() {}

	/**
	 * Check to ensure the Boolean value is always true.
	 */
	public static final Check ALWAYS_TRUE = b -> b.equals(Boolean.TRUE)
		?
		Check.Result.success()
		:
		Check.Result.failure("Must be 'true'.");

	/**
	 * Check to ensure the Boolean value is always false.
	 */
	public static final Check ALWAYS_FALSE = b -> b.equals(Boolean.FALSE)
		?
		Check.Result.success()
		:
		Check.Result.failure("Must be 'false'.");

	/**
	 * Check to ensure the parameter is a Boolean.
	 */
	public static final Check IS_BOOLEAN = Check.alwaysPass(Boolean.class);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy