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 void |
sneak(Sneaky.SneakyRunnable runnable)
Run a runnable without having to declare the throwable in the method signature.
|
static <O> O |
sneak(Sneaky.SneakySupplier<O> supplier)
Get a value from a supplier without having to declare the throwable in the method signature.
|
static void |
sneak(java.lang.Throwable t)
Throw a throwable without having to declare it in the method signature.
|
java.lang.Runnable |
toRunnable(Sneaky.SneakyRunnable runnable)
Convert a
Sneaky.SneakyRunnable to a Runnable. |
<O> O |
toSupplier(Sneaky.SneakySupplier<O> supplier)
Convert a
Sneaky.SneakySupplier to a Supplier. |
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 void sneak(java.lang.Throwable t)
t - The throwable to throwpublic static void sneak(Sneaky.SneakyRunnable runnable)
runnable - The runnable to runpublic static <O> O sneak(Sneaky.SneakySupplier<O> supplier)
O - The type of the valuesupplier - The supplier to get the value frompublic java.lang.Runnable toRunnable(Sneaky.SneakyRunnable runnable)
Sneaky.SneakyRunnable to a Runnable.runnable - The sneaky runnable to convertpublic <O> O toSupplier(Sneaky.SneakySupplier<O> supplier)
Sneaky.SneakySupplier to a Supplier.O - The type of the valuesupplier - The sneaky supplier to convert