Package org.springframework.web.servlet.mvc.method.annotation

# Interface SseEmitter.SseEventBuilder

Enclosing class:
  SseEmitter

public static interface SseEmitter.SseEventBuilder
A builder for an SSE event.

## Method Summary

Modifier and Type
Method
Description
`Set<ResponseBodyEmitter.DataWithMediaType>`
`build()`
Return one or more Object-MediaType pairs to write via `SseEmitter.send(Object, MediaType)`.
`SseEmitter.SseEventBuilder`
`comment(String comment)`
Add an SSE "comment" line.
`SseEmitter.SseEventBuilder`
`data(Object object)`
Add an SSE "data" line.
`SseEmitter.SseEventBuilder`
`data(Object object, org.springframework.http.MediaType mediaType)`
Add an SSE "data" line.
`SseEmitter.SseEventBuilder`
`id(String id)`
Add an SSE "id" line.
`SseEmitter.SseEventBuilder`
`name(String eventName)`
Add an SSE "event" line.
`SseEmitter.SseEventBuilder`
`reconnectTime(long reconnectTimeMillis)`
Add an SSE "retry" line.

## Method Details

### id

SseEmitter.SseEventBuilder id(String id)
Add an SSE "id" line.

### name

SseEmitter.SseEventBuilder name(String eventName)
Add an SSE "event" line.

### reconnectTime

SseEmitter.SseEventBuilder reconnectTime(long reconnectTimeMillis)
Add an SSE "retry" line.

### comment

SseEmitter.SseEventBuilder comment(String comment)
Add an SSE "comment" line.

### data

SseEmitter.SseEventBuilder data(Object object)
Add an SSE "data" line.

### data

SseEmitter.SseEventBuilder data(Object object, @Nullable org.springframework.http.MediaType mediaType)
Add an SSE "data" line.

### build

Set<ResponseBodyEmitter.DataWithMediaType> build()
Return one or more Object-MediaType pairs to write via `SseEmitter.send(Object, MediaType)`.

Since:
  4.2.3