Package org.atlanmod.commons
Class Throwables
- java.lang.Object
-
- org.atlanmod.commons.Throwables
-
@ParametersAreNonnullByDefault public final class Throwables extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RuntimeExceptionnotImplementedYet(String methodName)Returns a newRuntimeExceptionthrown when calling a method that is not yet implemented.static RuntimeExceptionnotInstantiableClass(Class<?> type)Returns a newRuntimeExceptionthrown when calling a constructor of a non-instantiable class.static RuntimeExceptionshouldNeverHappen(Throwable e)Returns a newRuntimeExceptionwhen a call leads to a state that should never have occurred under normal conditions.
-
-
-
Method Detail
-
shouldNeverHappen
@Nonnull public static RuntimeException shouldNeverHappen(Throwable e)
Returns a newRuntimeExceptionwhen a call leads to a state that should never have occurred under normal conditions.- Parameters:
e- the catched exception- Returns:
- a new runtime exception
-
notImplementedYet
@Nonnull public static RuntimeException notImplementedYet(String methodName)
Returns a newRuntimeExceptionthrown when calling a method that is not yet implemented.- Parameters:
methodName- the name of the method not implemented- Returns:
- a new runtime exception
-
notInstantiableClass
@Nonnull public static RuntimeException notInstantiableClass(Class<?> type)
Returns a newRuntimeExceptionthrown when calling a constructor of a non-instantiable class.- Parameters:
type- the non-instantiable class- Returns:
- a new runtime exception
- See Also:
Static
-
-