Record Class ServerSentEvent
java.lang.Object
java.lang.Record
io.axoniq.framework.springcloud.query.ServerSentEvent
- Record Components:
id- the event's identifier, ornullwhen the event carried none. A member reconnecting to a stream reports the last identifier it saw, letting the serving member resume where it left off.event- the event's type, naming what thedataholds. Defaults toDEFAULT_EVENT_TYPEwhen the stream did not name one, as the protocol prescribes.data- the event's payload. Multipledatalines in one event are joined with newlines, so this is the payload as the sending member wrote it.
A single event read from a Server-Sent Events stream.
- Since:
- 5.4.0
- Author:
- Allard Buijze
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe event type of an event that did not name one. -
Constructor Summary
ConstructorsConstructorDescriptionServerSentEvent(@Nullable String id, String event, String data) Compact constructor rejecting a missingeventordata. -
Method Summary
Modifier and TypeMethodDescriptiondata()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.event()Returns the value of theeventrecord component.final inthashCode()Returns a hash code value for this object.@Nullable Stringid()Returns the value of theidrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_EVENT_TYPE
The event type of an event that did not name one.- See Also:
-
-
Constructor Details
-
ServerSentEvent
Compact constructor rejecting a missingeventordata.
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
event
Returns the value of theeventrecord component.- Returns:
- the value of the
eventrecord component
-
data
Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-