Package com.gengoai.function
Interface CheckedFunction<T,R>
-
- Type Parameters:
T
- Functional parameterR
- Functional parameter
- All Superinterfaces:
Serializable
- 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 CheckedFunction<T,R> extends Serializable
Version of Function that is serializable and checked
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <V> CheckedFunction<T,V>
andThen(CheckedFunction<? super R,? extends V> after)
And then checked function.R
apply(T t)
Apply r.default CheckedConsumer<T>
asConsumer()
As consumer serializable consumer.static <T> CheckedConsumer<T>
asConsumer(CheckedFunction<T,?> function)
As consumer serializable consumer.default <V> CheckedFunction<V,R>
compose(CheckedFunction<? super V,? extends T> before)
Compose checked function.static <T> CheckedFunction<T,T>
identity()
Identity serializable function.static <T,R>
CheckedFunction<T,R>literal(R returnValue)
-
-
-
Method Detail
-
apply
R apply(T t) throws Throwable
Apply r.- Parameters:
t
- the t- Returns:
- the r
- Throws:
Throwable
- the throwable
-
asConsumer
default CheckedConsumer<T> asConsumer()
As consumer serializable consumer.- Returns:
- the serializable consumer
-
asConsumer
static <T> CheckedConsumer<T> asConsumer(CheckedFunction<T,?> function)
As consumer serializable consumer.- Returns:
- the serializable consumer
-
literal
static <T,R> CheckedFunction<T,R> literal(R returnValue)
-
compose
default <V> CheckedFunction<V,R> compose(CheckedFunction<? super V,? extends T> before)
Compose checked function.- Type Parameters:
V
- the type parameter- Parameters:
before
- the before- Returns:
- the checked function
-
andThen
default <V> CheckedFunction<T,V> andThen(CheckedFunction<? super R,? extends V> after)
And then checked function.- Type Parameters:
V
- the type parameter- Parameters:
after
- the after- Returns:
- the checked function
-
identity
static <T> CheckedFunction<T,T> identity()
Identity serializable function.- Type Parameters:
T
- the type parameter- Returns:
- the serializable function
-
-