Package org.sgrewritten.stargate.util
Class ExceptionHelper
java.lang.Object
org.sgrewritten.stargate.util.ExceptionHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Throwable>
booleandoesNotThrow
(Class<T> expectedType, Runnable runnable) static boolean
doesNotThrow
(Runnable runnable) static <T extends Throwable>
boolean
-
Method Details
-
doesThrow
- Type Parameters:
T
-Any throwable
- Parameters:
expectedType
-The expected type of the exception
runnable
-The function to be run
- Returns:
True if the exception got thrown
-
doesNotThrow
- Type Parameters:
T
-The expected type to not throw
- Parameters:
expectedType
-The expected type to not throw
runnable
-A function to run
- Returns:
True if the expected type did not throw
-
doesNotThrow
- Parameters:
runnable
-The runnable to check if it throws
- Returns:
True if runnable did not throw any exception
-