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.
@FunctionalInterface public interface IoToUncheckedFunction<I,O>
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Oapply(I i)static <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 Detail
-
wrap
static <In,Out> Function<In,Out> wrap(IoToUncheckedFunction<In,Out> wrapped)
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
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.- 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
O apply(I i) throws IOException
- Throws:
IOException- See Also:
Function.apply(Object)
-
wrapIoException
static UncheckedIOException wrapIoException(IOException ioe, Supplier<String> supp)
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.
-
-