de.caff.generics.function

## Interface Procedure0

- 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 Procedure0

  Function without return and with no parameter. In a pure functional world this is useless, but in the real world it can be useful sometimes.
  Author:
    Rammi
  See Also:
    `Procedure1`, `Procedure2`, `Procedure3`, `Procedure4`, `Procedure5`, `Procedure6`, `Procedure7`, `Procedure8`, `Procedure9`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Procedure0` | `NULL` Procedure with no arguments which does nothing.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `apply()` Run the function.
    `static <E extends java.lang.Exception> Procedure0` | `nonFragile(FragileProcedure0<E> fragileProc)` Convert a 0-argument procedure which might throw a checked exception into one which does throw an unchecked exception.
    `static <E extends java.lang.Exception> Procedure0` | `nonFragileX(FragileProcedure0<E> fragileProc, java.util.function.Consumer<? super E> exceptionHandler)` Convert a 0-argument procedure which might throw a checked exception into one for which you can decide what happens with the exception.

- - ### Field Detail

    - #### NULL

          @NotNull
          static final Procedure0 NULL

      Procedure with no arguments which does nothing.

  - ### Method Detail

    - #### apply

          void apply()

      Run the function.

    - #### nonFragile

          @NotNull
          static <E extends java.lang.Exception> Procedure0 nonFragile(@NotNull
                                                                                FragileProcedure0<E> fragileProc)

      Convert a 0-argument procedure which might throw a checked exception into one which does throw an unchecked exception. The returned function will instead throw an unchecked `WrappedFragileException` for any checked exception thrown during `apply()`.
      Type Parameters:
        `E` - exception type
      Parameters:
        `fragileProc` - procedure throwing a checked exception
      Returns:
        non-fragile procedure

    - #### nonFragileX

          @NotNull
          static <E extends java.lang.Exception> Procedure0 nonFragileX(@NotNull
                                                                                 FragileProcedure0<E> fragileProc,
                                                                                 @NotNull
                                                                                 java.util.function.Consumer<? super E> exceptionHandler)

      Convert a 0-argument procedure which might throw a checked exception into one for which you can decide what happens with the exception. The exception handler allows
      - throw an unchecked exception instead (compare `nonFragile(FragileProcedure0)`)
      - do nothing
      - include logging in one of the above
      - and more...
      Type Parameters:
        `E` - exception type
      Parameters:
        `fragileProc` - procedure throwing a checked exception
        `exceptionHandler` - exception handler. Its return value will be used as return value of the returned function.
      Returns:
        non-fragile function