public class Sneaky
extends java.lang.Object
| Constructor and Description |
|---|
Sneaky() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends java.lang.Throwable> |
fake(java.lang.Class<T> exceptionType)
A fake method to declare a checked exception without actually throwing it.
|
static void |
sneakyThrow(java.lang.Throwable t)
Throw a throwable sneakily without declaring it.
|
public static <T extends java.lang.Throwable> void fake(java.lang.Class<T> exceptionType)
throws T extends java.lang.Throwable
T - The exception typeexceptionType - The exception typeT - The declared exceptionT extends java.lang.Throwablepublic static void sneakyThrow(java.lang.Throwable t)
t - The throwable to throw