Interface Serializer<I,O>

Type Parameters:
I - the type of input
O - 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.

@FunctionalInterface public interface Serializer<I,O> extends Function<I,O>
An interface to "serialize" objects to other types.
  • Method Details

    • serialize

      @UnknownNullability O serialize(@NotNull I input)
      Serializes the object.
      Parameters:
      input - the object to serialize
      Returns:
      the serialized result
    • apply

      default O apply(I i)
      Applies the given object to serialize(Object).
      Specified by:
      apply in interface Function<I,O>
      Parameters:
      i - the function argument
      Returns:
      the deserialized result
      See Also:
    • compose

      @NotNull default <V> @NotNull Serializer<V,O> compose(@NotNull @NotNull Function<? super V,? extends I> before)
      Specified by:
      compose in interface Function<I,O>
    • andThen

      @NotNull default <V> @NotNull Serializer<I,V> andThen(@NotNull @NotNull Function<? super O,? extends V> after)
      Specified by:
      andThen in interface Function<I,O>