Interface Serializer<I,O>
- Type Parameters:
I- the type of inputO- the type of output
- All Superinterfaces:
Function<I,O>
- All Known Implementing Classes:
RecordSerializer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An interface to "serialize" objects to other types.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <V> @NotNull Serializer<I,V> default OApplies the given object toserialize(Object).default <V> @NotNull Serializer<V,O> @UnknownNullability OSerializes the object.
-
Method Details
-
serialize
Serializes the object.- Parameters:
input- the object to serialize- Returns:
- the serialized result
-
apply
Applies the given object toserialize(Object). -
compose
@NotNull default <V> @NotNull Serializer<V,O> compose(@NotNull @NotNull Function<? super V, ? extends I> before) -
andThen
@NotNull default <V> @NotNull Serializer<I,V> andThen(@NotNull @NotNull Function<? super O, ? extends V> after)
-