de.caff.generics.function

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

- Type Parameters:
    `R` - return type
    `E` - exception type
    `P` - parameter type
  All Known Subinterfaces:
    FragileFunction2<R,E,P1,P2>, FragileFunction3<R,E,P1,P2,P3>, FragileFunction4<R,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 FragileFunction1<R,E extends java.lang.Exception,P>

  Function with one parameter, possibly throwing an exception.
  Author:
    Rammi

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `R` | `apply(P arg)` Run the function.
    `default Function1<R,P>` | `nonFragile()` Convert this to a non-fragile function which does not throw a checked exception.
    `default Function1<R,P>` | `nonFragile(R fallback)` Convert this to a non-fragile function which does not throw a checked exception.
    `default Function1<R,P>` | `nonFragileX(java.util.function.BiFunction<? super E,? super P,? extends R> exceptionHandler)` Convert this to a non-fragile function which does not throw a checked exception.

- - ### Method Detail

    - #### apply

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

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

    - #### nonFragile

          @NotNull
          default Function1<R,P> nonFragile()

      Convert this to a non-fragile function 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:
        `Function1.nonFragile(FragileFunction1)`

    - #### nonFragile

          @NotNull
          default Function1<R,P> nonFragile(R fallback)

      Convert this to a non-fragile function which does not throw a checked exception. This will instead return the `fallback` value. Please note that in this case the exception is completely lost!
      Parameters:
        `fallback` - fallback value
      Returns:
        non-fragile function
      See Also:
        `Function1.nonFragile(FragileFunction1, Object)`

    - #### nonFragileX

          @NotNull
          default Function1<R,P> nonFragileX(@NotNull
                                                      java.util.function.BiFunction<? super E,? super P,? extends R> exceptionHandler)

      Convert this to a non-fragile function which does not throw a checked exception.
      Parameters:
        `exceptionHandler` - handler which can handle the exception how it sees fit. E.g. throw an unchecked exception (compare `nonFragile()`, return a fallback (compare `nonFragile(Object)`), or do the latter but also log or collect the exception
      Returns:
        non-fragile function
      See Also:
        `Function1.nonFragileX(FragileFunction1, BiFunction)`