Skip to content

Commit

Permalink
feat(api): ThrowableSupplier for Optional.orElseThrow
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Apr 11, 2022
1 parent 4cf18df commit d2b9dcf
Showing 1 changed file with 26 additions and 0 deletions.
@@ -0,0 +1,26 @@
package org.auioc.mcmod.arnicalib.api.java.function;

import java.util.function.Supplier;

@FunctionalInterface
public interface ThrowableSupplier<E extends Throwable> {

Supplier<E> create(String message);

@FunctionalInterface
public static interface Any extends ThrowableSupplier<Throwable> {
}

@FunctionalInterface
public static interface Error extends ThrowableSupplier<java.lang.Error> {
}

@FunctionalInterface
public static interface Exception extends ThrowableSupplier<java.lang.Exception> {
}

@FunctionalInterface
public static interface RuntimeException extends ThrowableSupplier<java.lang.RuntimeException> {
}

}

0 comments on commit d2b9dcf

Please sign in to comment.