Class CommentEvent

  • All Implemented Interfaces:
    StreamEvent

    public final class CommentEvent
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      CommentEvent​(java.lang.String text)
      Creates an instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.String getText()
      Returns the comment text, not including the leading colon.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CommentEvent

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

      • getText

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

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object