Package bridge

Class Unchecked

All Implemented Interfaces:
Serializable

public final class Unchecked extends RuntimeException
A class for interacting with unchecked exceptions
See Also:
Notes:
The constructor for this class does not actually construct anything – so, the imaginary object must be immediately thrown for your code to compile correctly.
  • Constructor Details

    • Unchecked

      public Unchecked(Throwable e)
      Allows any type of exception to become unchecked
      Parameters:
      e - Exception
  • Method Details

    • check

      public static <E extends Throwable> void check() throws E
      Brings an (unchecked) exception into scope
      Type Parameters:
      E - Exception type
      Throws:
      E extends Throwable