Interface ExceptionTrigger

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ExceptionTrigger
Functional interface that represents a trigger function that throws a checked exception when activated. It resembles a Trigger but its intent is to declare a block that contains an exception, so that it can be thrown at different stages without duplication. For example, you can include logging and a throw statement in a single block.

It is also useful for wrapping checked exceptions in contexts where explicit exception handling would clutter the code, such as in lambda expressions or method references.

Since:
0.1.0
Author:
Yoham Gabriel B.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Activates the trigger function, throwing the exception.
  • Method Details

    • throwing

      void throwing()
      Activates the trigger function, throwing the exception.