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

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

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

import java.util.function.Function;

@FunctionalInterface
public interface TryF extends Function {
    R tryApply(T t) throws E;

    @SuppressWarnings("OverlyBroadCatchBlock")
    default R apply(T t) {
        try {
            return tryApply(t);
        } catch (Exception e) {
            throw new ResultException(e);
        }
    }

    static  TryF of(Function f) {
        return f::apply;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy