
net.mostlyoriginal.api.utils.Preconditions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of artemis-odb Show documentation
Show all versions of artemis-odb Show documentation
Fork of Artemis Entity System Framework.
The newest version!
package net.mostlyoriginal.api.utils;
/**
* @author Daan van Yperen
*/
public final class Preconditions {
private Preconditions() {}
public static void checkArgument(boolean expression) {
if ( !expression ) {
throw new IllegalArgumentException();
}
}
public static void checkArgument(boolean expression, String message) {
if ( !expression ) {
throw new IllegalArgumentException(message);
}
}
public static T checkNotNull(T reference) {
if ( reference == null ) {
throw new NullPointerException();
}
return reference;
}
public static T checkNotNull(T reference, String message) {
if ( reference == null ) {
throw new NullPointerException(message);
}
return reference;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy