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

com.fitbur.failsafe.internal.util.Assert Maven / Gradle / Ivy

The newest version!
package com.fitbur.failsafe.internal.util;

/**
 * @author Jonathan Halterman
 */
public final class Assert {
  private Assert() {
  }

  public static void isTrue(boolean expression, String errorMessageFormat, Object... args) {
    if (!expression)
      throw new IllegalArgumentException(String.format(errorMessageFormat, args));
  }

  public static  T notNull(T reference, String parameterName) {
    if (reference == null)
      throw new NullPointerException(parameterName + " cannot be null");
    return reference;
  }

  public static void state(boolean expression, String errorMessageFormat, Object... args) {
    if (!expression)
      throw new IllegalStateException(String.format(errorMessageFormat, args));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy