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

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

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

import java.util.function.Consumer;

@FunctionalInterface
public interface TryC extends Consumer {
    void tryAccept(T t) throws E;

    @SuppressWarnings("OverlyBroadCatchBlock")
    default void accept(T t) {
        try {
            tryAccept(t);
        } catch (Exception e) {
            throw new ResultException(e);
        }
    }

    static  TryC of(Consumer f) {
        return f::accept;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy