io.github.spair.byond.dmi.CheckSupplierUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of byond-dmi-util Show documentation
Show all versions of byond-dmi-util Show documentation
Small set of util classes to work with BYOND dmi files.
package io.github.spair.byond.dmi;
import java.util.function.BooleanSupplier;
import java.util.function.Function;
final class CheckSupplierUtil {
static R returnIfNonNull(final T toCheck, final Function toApply) {
return toCheck != null ? toApply.apply(toCheck) : null;
}
static R returnIfNonNullAndTrue(
final T toCheck, final BooleanSupplier boolCheck, final Function toApply) {
return toCheck != null && boolCheck.getAsBoolean() ? toApply.apply(toCheck) : null;
}
private CheckSupplierUtil() {
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy