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

de.siegmar.fastcsv.util.Preconditions Maven / Gradle / Ivy

Go to download

Lightning-fast, dependency-free CSV library that conforms to RFC standards.

There is a newer version: 3.4.0
Show newest version
package de.siegmar.fastcsv.util;

/**
 * Internal utility class.
 * 

* It is not a part of the API! */ public final class Preconditions { private Preconditions() { } /** * Checks the given argument and throws an exception if not met. * * @param expression the expression that has to be {@code true} * @param errorMessage the exception message to be thrown * @throws IllegalArgumentException if the {@code expression} is {@code false}. */ public static void checkArgument(final boolean expression, final String errorMessage) { if (!expression) { throw new IllegalArgumentException(errorMessage); } } /** * Checks the given argument and throws an exception if not met. * * @param expression the expression that has to be {@code true} * @param errorMessageTemplate the exception message template (format {@link String#format(String, Object...)}) * to be thrown * @param errorMessageArgs the exception message arguments * @throws IllegalArgumentException if the {@code expression} is {@code false}. */ public static void checkArgument(final boolean expression, final String errorMessageTemplate, final Object... errorMessageArgs) { if (!expression) { throw new IllegalArgumentException(String.format(errorMessageTemplate, errorMessageArgs)); } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy