Package com.gengoai.function
Interface SerializableFunction<T,R>
-
- Type Parameters:
T
- Functional parameterR
- Functional parameter
- All Superinterfaces:
Function<T,R>
,Serializable
- All Known Implementing Classes:
Funcs.When
,StringFunctions
,Switch
- 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 SerializableFunction<T,R> extends Function<T,R>, Serializable
Version of Function that is serializable
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default <F> SerializableFunction<T,F>
andThen(SerializableFunction<? super R,? extends F> function)
And then serializable function.default SerializableConsumer<T>
asConsumer()
As consumer serializable consumer.static <T> SerializableConsumer<T>
asConsumer(SerializableFunction<T,?> function)
As consumer serializable consumer.default <V> SerializableFunction<V,R>
compose(SerializableFunction<? super V,? extends T> function)
Compose serializable function.static <T> SerializableFunction<T,T>
identity()
Identity serializable function.static <T,R>
SerializableFunction<T,R>literal(R returnValue)
-
-
-
Method Detail
-
literal
static <T,R> SerializableFunction<T,R> literal(R returnValue)
-
asConsumer
static <T> SerializableConsumer<T> asConsumer(SerializableFunction<T,?> function)
As consumer serializable consumer.- Returns:
- the serializable consumer
-
asConsumer
default SerializableConsumer<T> asConsumer()
As consumer serializable consumer.- Returns:
- the serializable consumer
-
andThen
default <F> SerializableFunction<T,F> andThen(SerializableFunction<? super R,? extends F> function)
And then serializable function.- Type Parameters:
F
- the type parameter- Parameters:
function
- the function- Returns:
- the serializable function
-
compose
default <V> SerializableFunction<V,R> compose(SerializableFunction<? super V,? extends T> function)
Compose serializable function.- Type Parameters:
V
- the type parameter- Parameters:
function
- the function- Returns:
- the serializable function
-
identity
static <T> SerializableFunction<T,T> identity()
Identity serializable function.- Type Parameters:
T
- the type parameter- Returns:
- the serializable function
-
-