Class CommentEvent

java.lang.Object
com.launchdarkly.eventsource.CommentEvent
All Implemented Interfaces:
StreamEvent

public final class CommentEvent extends Object implements StreamEvent
Describes a comment line received from the stream.

An SSE comment is a line that starts with a colon. There is no defined meaning for this in the SSE specification, and most clients ignore it. It may be used to provide a periodic heartbeat from the server to keep connections from timing out.

Since:
4.0.0
  • Constructor Details

    • CommentEvent

      public CommentEvent(String text)
      Creates an instance.
      Parameters:
      text - the comment text, not including the leading colon
  • Method Details

    • getText

      public String getText()
      Returns the comment text, not including the leading colon.
      Returns:
      the text
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object