Interface ResponseBody.Sse.EventFactory<A,B extends ResponseBody.Sse.Event<A>>

Type Parameters:
A - the type of data sent in the event data
B - the server-sent event type
All Known Subinterfaces:
WebResponseBody.SseEncoder.EventFactory<A>
Enclosing interface:
ResponseBody.Sse<A,B extends ResponseBody.Sse.Event<A>,C extends ResponseBody.Sse.EventFactory<A,B>>
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 static interface ResponseBody.Sse.EventFactory<A,B extends ResponseBody.Sse.Event<A>>

A server-sent event factory is used to create server-sent events.

Since:
1.0
Author:
Jeremy Kuhn
  • Method Summary

    Modifier and Type
    Method
    Description
    default B
    Creates an empty server-sent event.
    create(Consumer<B> configurer)
    Creates a server-sent event with the specified configurer.
  • Method Details

    • create

      B create(Consumer<B> configurer)

      Creates a server-sent event with the specified configurer.

      Parameters:
      configurer - a server-sent event configurer
      Returns:
      a new server-sent event
    • create

      default B create()

      Creates an empty server-sent event.

      Returns:
      a new server-sent event