org.dataloader.impl.Assertions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-dataloader Show documentation
Show all versions of java-dataloader Show documentation
A pure Java 8 port of Facebook Dataloader
package org.dataloader.impl;
import org.dataloader.annotations.Internal;
import java.util.function.Supplier;
@Internal
public class Assertions {
public static void assertState(boolean state, Supplier message) {
if (!state) {
throw new DataLoaderAssertionException(message.get());
}
}
public static T nonNull(T t) {
return nonNull(t, () -> "nonNull object required");
}
public static T nonNull(T t, Supplier message) {
if (t == null) {
throw new NullPointerException(message.get());
}
return t;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy