Interface OutboundData<A>

Type Parameters:
A - the type of data
All Known Subinterfaces:
OutboundDataEncoder<A>, Part<A>, ResponseBody.Sse.Event<A>, WebResponseBody.SseEncoder.Event<A>
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 OutboundData<A>

A generic outbound data producer.

It is used to set the payload sent to a client or a server either in a response or a request.

Since:
1.6
Author:
Jeremy Kuhn
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends A>
    void
    stream(Publisher<T> value)
    Sets the outbound data.
    default <T extends A>
    void
    value(T value)
    Sets the specified data.
  • Method Details

    • stream

      <T extends A> void stream(Publisher<T> value) throws IllegalStateException

      Sets the outbound data.

      Type Parameters:
      T - the type of data
      Parameters:
      value - the data publisher
      Throws:
      IllegalStateException - if data were already sent to the recipient
    • value

      default <T extends A> void value(T value) throws IllegalStateException

      Sets the specified data.

      Type Parameters:
      T - the type of data
      Parameters:
      value - the value to set
      Throws:
      IllegalStateException - if data were already sent to the recipient