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

io.github.spair.byond.dmi.CheckSupplierUtil Maven / Gradle / Ivy

There is a newer version: 2.1
Show newest version
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