Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): ThrowableSupplier for Optional.orElseThrow
- Loading branch information
1 parent
4cf18df
commit d2b9dcf
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/main/java/org/auioc/mcmod/arnicalib/api/java/function/ThrowableSupplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> { | ||
} | ||
|
||
} |