Interface OutboundDataEncoder<A>

Type Parameters:
A - the type of the object to encode
All Superinterfaces:
OutboundData<A>
All Known Subinterfaces:
WebPart<A>, WebResponseBody.SseEncoder.Event<A>

public interface OutboundDataEncoder<A> extends OutboundData<A>

An outbound data producer used to encode payload data from a single object or many objects.

Implementors should rely on a MediaTypeConverter to encode payload data as a publisher of objects to a raw payload as a publisher of ByteBuf.

Since:
1.12
Author:
Jeremy Kuhn
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default <T extends A>
    void
    many(Iterable<T> value)
    Encodes many objects.
    <T extends A>
    void
    many(Flux<T> value)
    Encodes many objects.
    <T extends A>
    void
    one(Mono<T> value)
    Encodes one object.
    default <T extends A>
    void
    one(T value)
    Encodes one object.

    Methods inherited from interface io.inverno.mod.http.base.OutboundData

    stream, value
  • Method Details

    • many

      default <T extends A> void many(Iterable<T> value)

      Encodes many objects.

      Type Parameters:
      T - the type of the object to encode
      Parameters:
      value - the list of objects to encode
    • many

      <T extends A> void many(Flux<T> value)

      Encodes many objects.

      Type Parameters:
      T - the type of the object to encode
      Parameters:
      value - a flux emitting the objects to encode
    • one

      default <T extends A> void one(T value)

      Encodes one object.

      Type Parameters:
      T - the type of the object to encode
      Parameters:
      value - the object to encode
    • one

      <T extends A> void one(Mono<T> value)

      Encodes one object.

      Type Parameters:
      T - the type of the object to encode
      Parameters:
      value - a mono emitting the object to encode