インターフェース ServerSentEvent.Builder<T>

型パラメーター:
T - このイベントに含まれるデータの型
含まれているクラス:
ServerSentEvent<T>

public static interface ServerSentEvent.Builder<T>
SseEvent の変更可能なビルダー。
  • メソッドの詳細

    • id

      id フィールドの値を設定します。
      パラメーター:
      id - id フィールドの値
      戻り値:
      this ビルダー
    • event

      event フィールドの値を設定します。
      パラメーター:
      event - イベントフィールドの値
      戻り値:
      this ビルダー
    • retry

      retry フィールドの値を設定します。
      パラメーター:
      retry - 再試行フィールドの値
      戻り値:
      this ビルダー
    • comment

      ServerSentEvent.Builder<T> comment(StringSE comment)
      SSE コメントを設定します。複数行のコメントが提供された場合、サーバー送信イベント W3C 勧告で定義されているように複数の SSE コメント行に変換されます。
      パラメーター:
      comment - 設定するコメント
      戻り値:
      this ビルダー
    • data

      data フィールドの値を設定します。data 引数が複数行の String である場合、Server-Sent Events W3C 勧告で定義されているように、複数の data フィールド行に変換されます。data が文字列でない場合は、JSON にエンコードされます。
      パラメーター:
      data - データフィールドの値
      戻り値:
      this ビルダー
    • build

      ServerSentEvent<T> build()
      イベントを作成します。
      戻り値:
      構築されたイベント