Interface IoToUncheckedFunction<I,O>

Type Parameters:
I - The type of the first argument of the Function.
O - The type of the result of the Function.
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 IoToUncheckedFunction<I,O>
A Function that wraps a thrown IOException in a UncheckedIOException.
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(I i)
     
    static <In, Out> Function<In,Out>
    wrap(IoToUncheckedFunction<In,Out> wrapped)
    Wraps the designated Function by wrapping the thrown IOException in a UncheckedIOException.
    static <In, Out> Function<In,Out>
    wrap(IoToUncheckedFunction<In,Out> wrapped, String msg)
    Wraps the designated Function by wrapping the thrown IOException in a UncheckedIOException with the message of the designated supplier.
    static <In, Out> Function<In,Out>
    wrap(IoToUncheckedFunction<In,Out> wrapped, Function<? super In,String> msgFunc)
    Wraps the designated Function by wrapping the thrown IOException in a UncheckedIOException with the message of the designated supplier.
    static <In, Out> Function<In,Out>
    wrap(IoToUncheckedFunction<In,Out> wrapped, Supplier<String> msgSupp)
    Wraps the designated Function by wrapping the thrown IOException in a UncheckedIOException with the message of the designated supplier.
    Wraps the designated IOException in a new UncheckedIOException having the designated message (if supplied).
  • Method Details

    • wrap

      static <In, Out> Function<In,Out> wrap(IoToUncheckedFunction<In,Out> wrapped)
      Wraps the designated Function by wrapping the thrown IOException in a UncheckedIOException.
      Type Parameters:
      In - The type of the first argument of the Function.
      Out - The type of the result of the Function.
      Parameters:
      wrapped - The Function throwing an IOException.
      Returns:
      A Function throwing an UncheckedIOException.
    • wrap

      static <In, Out> Function<In,Out> wrap(IoToUncheckedFunction<In,Out> wrapped, String msg)
      Wraps the designated Function by wrapping the thrown IOException in a UncheckedIOException with the message of the designated supplier.
      Type Parameters:
      In - The type of the first argument of the Function.
      Out - The type of the result of the Function.
      Parameters:
      wrapped - The Function throwing an IOException.
      msg - The message for the wrapping UncheckedIOException. If this is null, the wrapping UncheckedIOException will not have a message.
      Returns:
      A Function throwing an UncheckedIOException.
    • wrap

      static <In, Out> Function<In,Out> wrap(IoToUncheckedFunction<In,Out> wrapped, Supplier<String> msgSupp)
      Wraps the designated Function by wrapping the thrown IOException in a UncheckedIOException with the message of the designated supplier.
      Type Parameters:
      In - The type of the first argument of the Function.
      Out - The type of the result of the Function.
      Parameters:
      wrapped - The Function throwing an IOException.
      msgSupp - The supplier providing a message for the wrapping UncheckedIOException. If this is null or supplies null, the wrapping UncheckedIOException will not have a message.
      Returns:
      A Function throwing an UncheckedIOException.
    • wrap

      static <In, Out> Function<In,Out> wrap(IoToUncheckedFunction<In,Out> wrapped, Function<? super In,String> msgFunc)
      Wraps the designated Function by wrapping the thrown IOException in a UncheckedIOException with the message of the designated supplier.
      Type Parameters:
      In - The type of the first argument of the Function.
      Out - The type of the result of the Function.
      Parameters:
      wrapped - The Function throwing an IOException.
      msgFunc - The Function providing a message for the wrapping UncheckedIOException when applied to the argument of wrapped. If this is null or supplies null, the wrapping UncheckedIOException will not have a message.
      Returns:
      A Function throwing an UncheckedIOException.
    • apply

      O apply(I i) throws IOException
      Throws:
      IOException
      See Also:
    • wrapIoException

      static UncheckedIOException wrapIoException(IOException ioe, Supplier<String> supp)
      Wraps the designated IOException in a new UncheckedIOException having the designated message (if supplied).
      Parameters:
      ioe - The IOException which to wrap in an UncheckedIOException.
      supp - The supplier providing a message for the wrapping UncheckedIOException. If this is null or supplies null, the wrapping UncheckedIOException will not have a message.
      Returns:
      The UncheckedIOException wrapping the designated IOException.