Package de.aristaflow.ilm.util
Interface IoToUncheckedFunction<I,O>
- Type Parameters:
I- The type of the first argument of theFunction.O- The type of the result of theFunction.
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <In,Out> Function<In, Out> wrap(IoToUncheckedFunction<In, Out> wrapped) Wraps the designatedFunctionby wrapping the thrownIOExceptionin aUncheckedIOException.static <In,Out> Function<In, Out> wrap(IoToUncheckedFunction<In, Out> wrapped, String msg) Wraps the designatedFunctionby wrapping the thrownIOExceptionin aUncheckedIOExceptionwith the message of the designated supplier.static <In,Out> Function<In, Out> wrap(IoToUncheckedFunction<In, Out> wrapped, Function<? super In, String> msgFunc) Wraps the designatedFunctionby wrapping the thrownIOExceptionin aUncheckedIOExceptionwith the message of the designated supplier.static <In,Out> Function<In, Out> wrap(IoToUncheckedFunction<In, Out> wrapped, Supplier<String> msgSupp) Wraps the designatedFunctionby wrapping the thrownIOExceptionin aUncheckedIOExceptionwith the message of the designated supplier.static UncheckedIOExceptionwrapIoException(IOException ioe, Supplier<String> supp) Wraps the designatedIOExceptionin a newUncheckedIOExceptionhaving the designated message (if supplied).
-
Method Details
-
wrap
Wraps the designatedFunctionby wrapping the thrownIOExceptionin aUncheckedIOException.- Type Parameters:
In- The type of the first argument of theFunction.Out- The type of the result of theFunction.- Parameters:
wrapped- TheFunctionthrowing anIOException.- Returns:
- A
Functionthrowing anUncheckedIOException.
-
wrap
Wraps the designatedFunctionby wrapping the thrownIOExceptionin aUncheckedIOExceptionwith the message of the designated supplier.- Type Parameters:
In- The type of the first argument of theFunction.Out- The type of the result of theFunction.- Parameters:
wrapped- TheFunctionthrowing anIOException.msg- The message for the wrappingUncheckedIOException. If this isnull, the wrappingUncheckedIOExceptionwill not have a message.- Returns:
- A
Functionthrowing anUncheckedIOException.
-
wrap
static <In,Out> Function<In,Out> wrap(IoToUncheckedFunction<In, Out> wrapped, Supplier<String> msgSupp) Wraps the designatedFunctionby wrapping the thrownIOExceptionin aUncheckedIOExceptionwith the message of the designated supplier.- Type Parameters:
In- The type of the first argument of theFunction.Out- The type of the result of theFunction.- Parameters:
wrapped- TheFunctionthrowing anIOException.msgSupp- The supplier providing a message for the wrappingUncheckedIOException. If this isnullor suppliesnull, the wrappingUncheckedIOExceptionwill not have a message.- Returns:
- A
Functionthrowing anUncheckedIOException.
-
wrap
static <In,Out> Function<In,Out> wrap(IoToUncheckedFunction<In, Out> wrapped, Function<? super In, String> msgFunc) Wraps the designatedFunctionby wrapping the thrownIOExceptionin aUncheckedIOExceptionwith the message of the designated supplier.- Type Parameters:
In- The type of the first argument of theFunction.Out- The type of the result of theFunction.- Parameters:
wrapped- TheFunctionthrowing anIOException.msgFunc- TheFunctionproviding a message for the wrappingUncheckedIOExceptionwhen applied to the argument ofwrapped. If this isnullor suppliesnull, the wrappingUncheckedIOExceptionwill not have a message.- Returns:
- A
Functionthrowing anUncheckedIOException.
-
apply
- Throws:
IOException- See Also:
-
wrapIoException
Wraps the designatedIOExceptionin a newUncheckedIOExceptionhaving the designated message (if supplied).- Parameters:
ioe- TheIOExceptionwhich to wrap in anUncheckedIOException.supp- The supplier providing a message for the wrappingUncheckedIOException. If this isnullor suppliesnull, the wrappingUncheckedIOExceptionwill not have a message.- Returns:
- The
UncheckedIOExceptionwrapping the designatedIOException.
-