public class Sneaky
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Sneaky.SneakyRunnable |
static interface |
Sneaky.SneakySupplier<T> |
| Constructor and Description |
|---|
Sneaky() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends java.lang.Throwable> |
fake(java.lang.Class<T> exceptionType)
Fake throw an exception to have to declare it in the method signature.
|
static <T extends java.lang.Throwable> |
sneak(Sneaky.SneakyRunnable runnable)
Run a runnable without having to declare the throwable in the method signature.
|
static <O,T extends java.lang.Throwable> |
sneak(Sneaky.SneakySupplier<O> supplier)
Get a value from a supplier without having to declare the throwable in the method signature.
|
static <T extends java.lang.Throwable> |
sneak(java.lang.Throwable t)
Throw a throwable without having to declare it in the method signature.
|
public static <T extends java.lang.Throwable> void fake(java.lang.Class<T> exceptionType)
throws T extends java.lang.Throwable
sneak(java.lang.Throwable)T - The type of the exceptionexceptionType - The type of the exception to fake throwT - The exceptionT extends java.lang.Throwablepublic static <T extends java.lang.Throwable> void sneak(java.lang.Throwable t)
throws T extends java.lang.Throwable
T - The type of the throwablet - The throwable to throwT - The throwableT extends java.lang.Throwablepublic static <T extends java.lang.Throwable> void sneak(Sneaky.SneakyRunnable runnable) throws T extends java.lang.Throwable
T - The type of the throwablerunnable - The runnable to runT - The throwableT extends java.lang.Throwablepublic static <O,T extends java.lang.Throwable> O sneak(Sneaky.SneakySupplier<O> supplier) throws T extends java.lang.Throwable
O - The type of the valueT - The type of the throwablesupplier - The supplier to get the value fromT - The throwableT extends java.lang.Throwable