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

net.diversionmc.error.TryP Maven / Gradle / Ivy

There is a newer version: 1.29.2
Show newest version
package net.diversionmc.error;

import java.util.function.Predicate;

@FunctionalInterface
public interface TryP extends Predicate {
    boolean tryTest(T t) throws E;

    @SuppressWarnings("OverlyBroadCatchBlock")
    default boolean test(T t) {
        try {
            return tryTest(t);
        } catch (Exception e) {
            throw new ResultException(e);
        }
    }

    static  TryP of(Predicate f) {
        return f::test;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy