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 O
apply(I i)
static <In,Out>
Function<In,Out>wrap(IoToUncheckedFunction<In,Out> wrapped)
Wraps the designatedFunction
by wrapping the thrownIOException
in aUncheckedIOException
.static <In,Out>
Function<In,Out>wrap(IoToUncheckedFunction<In,Out> wrapped, String msg)
Wraps the designatedFunction
by wrapping the thrownIOException
in aUncheckedIOException
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 designatedFunction
by wrapping the thrownIOException
in aUncheckedIOException
with the message of the designated supplier.static <In,Out>
Function<In,Out>wrap(IoToUncheckedFunction<In,Out> wrapped, Supplier<String> msgSupp)
Wraps the designatedFunction
by wrapping the thrownIOException
in aUncheckedIOException
with the message of the designated supplier.static UncheckedIOException
wrapIoException(IOException ioe, Supplier<String> supp)
Wraps the designatedIOException
in a newUncheckedIOException
having the designated message (if supplied).
-
-
-
Method Detail
-
wrap
static <In,Out> Function<In,Out> wrap(IoToUncheckedFunction<In,Out> wrapped)
Wraps the designatedFunction
by wrapping the thrownIOException
in aUncheckedIOException
.- Type Parameters:
In
- The type of the first argument of theFunction
.Out
- The type of the result of theFunction
.- Parameters:
wrapped
- TheFunction
throwing anIOException
.- Returns:
- A
Function
throwing anUncheckedIOException
.
-
wrap
static <In,Out> Function<In,Out> wrap(IoToUncheckedFunction<In,Out> wrapped, String msg)
Wraps the designatedFunction
by wrapping the thrownIOException
in aUncheckedIOException
with 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
- TheFunction
throwing anIOException
.msg
- The message for the wrappingUncheckedIOException
. If this isnull
, the wrappingUncheckedIOException
will not have a message.- Returns:
- A
Function
throwing anUncheckedIOException
.
-
wrap
static <In,Out> Function<In,Out> wrap(IoToUncheckedFunction<In,Out> wrapped, Supplier<String> msgSupp)
Wraps the designatedFunction
by wrapping the thrownIOException
in aUncheckedIOException
with 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
- TheFunction
throwing anIOException
.msgSupp
- The supplier providing a message for the wrappingUncheckedIOException
. If this isnull
or suppliesnull
, the wrappingUncheckedIOException
will not have a message.- Returns:
- A
Function
throwing anUncheckedIOException
.
-
wrap
static <In,Out> Function<In,Out> wrap(IoToUncheckedFunction<In,Out> wrapped, Function<? super In,String> msgFunc)
Wraps the designatedFunction
by wrapping the thrownIOException
in aUncheckedIOException
with 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
- TheFunction
throwing anIOException
.msgFunc
- TheFunction
providing a message for the wrappingUncheckedIOException
when applied to the argument ofwrapped
. If this isnull
or suppliesnull
, the wrappingUncheckedIOException
will not have a message.- Returns:
- A
Function
throwing 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 designatedIOException
in a newUncheckedIOException
having the designated message (if supplied).- Parameters:
ioe
- TheIOException
which to wrap in anUncheckedIOException
.supp
- The supplier providing a message for the wrappingUncheckedIOException
. If this isnull
or suppliesnull
, the wrappingUncheckedIOException
will not have a message.- Returns:
- The
UncheckedIOException
wrapping the designatedIOException
.
-
-