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

org.rnorth.ducttape.Preconditions Maven / Gradle / Ivy

Go to download

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