Class Throwables


  • @ParametersAreNonnullByDefault
    public final class Throwables
    extends Object
    Static utility methods related to Throwable and Exception instances.
    • Method Detail

      • shouldNeverHappen

        @Nonnull
        public static RuntimeException shouldNeverHappen​(Throwable e)
        Returns a new RuntimeException when 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 new RuntimeException thrown 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 new RuntimeException thrown when calling a constructor of a non-instantiable class.
        Parameters:
        type - the non-instantiable class
        Returns:
        a new runtime exception
        See Also:
        Static