
org.rnorth.ducttape.Preconditions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of duct-tape Show documentation
Show all versions of duct-tape Show documentation
General purpose resilience utilities for Java 8 (circuit breakers, timeouts, rate limiters, and handlers for unreliable or inconsistent results)
The newest version!
package org.rnorth.ducttape;
/**
* Simple Preconditions check implementation.
*/
public class Preconditions {
/**
* Check that a given condition is true. Will throw an IllegalArgumentException otherwise.
* @param message message to display if the precondition check fails
* @param condition the result of evaluating the condition
*/
public static void check(String message, boolean condition) {
if (!condition) {
throw new IllegalArgumentException("Precondition failed: " + message);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy