de.caff.generics.function

## Interface FragileProcedure1<E extends java.lang.Exception,P>

- Type Parameters:
    `P` - parameter type
    `E` - exception type
  All Known Subinterfaces:
    FragileProcedure2<E,P1,P2>, FragileProcedure3<E,P1,P2,P3>, FragileProcedure4<E,P1,P2,P3,P4>
  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 FragileProcedure1<E extends java.lang.Exception,P>

  Function without return and with one parameter. This provides the same functional interface as modern Java's `Consumer`, but in a more extensible way. As it is extending `Consumer` it can be used anywhere a `Consumer` is expected.
  Author:
    Rammi
  See Also:
    `FragileProcedure0`, `FragileProcedure2`, `FragileProcedure3`, `Procedure1`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static FragileProcedure1<?,?>` | `NULL` Procedure with one argument which does nothing, not even throwing.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `apply(P arg)` Run the function.
    `default void` | `applyNonNull(P argument)` Apply this procedure only if the argument is not `null`.
    `static <X extends java.lang.Exception,T> FragileProcedure1<X,T>` | `empty()` Return a procedure which does nothing, not even throw.
    `default Procedure1<P>` | `nonFragile()` Convert this to a non-fragile procedure which does not throw a checked exception.
    `default Procedure1<P>` | `nonFragileX(java.util.function.BiConsumer<? super E,? super P> exceptionHandler)` Convert this to a non-fragile procedure which does not a checked exception.
    `default FragileProcedure0<E>` | `partial(P argument)` Return a partial evaluation of this procedure.

- - ### Field Detail

    - #### NULL

          @NotNull
          static final FragileProcedure1<?,?> NULL

      Procedure with one argument which does nothing, not even throwing. Use `empty()` instead.

  - ### Method Detail

    - #### apply

          void apply(P arg)
              throws E extends java.lang.Exception

      Run the function.
      Parameters:
        `arg` - function argument
      Throws:
        `E` - exception
        `E extends java.lang.Exception`

    - #### nonFragile

          @NotNull
          default Procedure1<P> nonFragile()

      Convert this to a non-fragile procedure which does not throw a checked exception. This will instead throw an unchecked `WrappedFragileException` for any checked exception thrown during `apply(Object)`.
      Returns:
        non-fragile function
      See Also:
        `Procedure1.nonFragile(FragileProcedure1)`

    - #### nonFragileX

          @NotNull
          default Procedure1<P> nonFragileX(@NotNull
                                                     java.util.function.BiConsumer<? super E,? super P> exceptionHandler)

      Convert this to a non-fragile procedure which does not a checked exception. This will instead throw an unchecked `WrappedFragileException` for any checked exception thrown during `apply(Object)`.
      Parameters:
        `exceptionHandler` - handler called when an exception is encountered. It may either ignore it, throw an unchecked exception, or collect the exceptions
      Returns:
        non-fragile function
      See Also:
        `Procedure1.nonFragileX(FragileProcedure1, BiConsumer)`

    - #### applyNonNull

          default void applyNonNull(@Nullable
                                    P argument)
                             throws E extends java.lang.Exception

      Apply this procedure only if the argument is not `null`.

      Using this invocation it is guaranteed that `apply(Object)` will always be called with a non-null argument.

      Use `Types.notNull(Object, Object)` if yo want to invoke this with a default argument when `argument` is `null`.

      Parameters:
        `argument` - argument of this function, possibly `null`
      Throws:
        `E` - exception
        `E extends java.lang.Exception`

    - #### partial

          @NotNull
          default FragileProcedure0<E> partial(P argument)

      Return a partial evaluation of this procedure.
      Parameters:
        `argument` - constant argument use for the evaluation
      Returns:
        zero argument procedure

    - #### empty

          @NotNull
          static <X extends java.lang.Exception,T> FragileProcedure1<X,T> empty()

      Return a procedure which does nothing, not even throw. This just returns `NULL`, but the compiler will accept it smoothly.
      Type Parameters:
        `X` - exception type
        `T` - argument type
      Returns:
        do-nothing procedure