Package org.mockserver.llm.realtime
Record Class RealtimeEvent
java.lang.Object
java.lang.Record
org.mockserver.llm.realtime.RealtimeEvent
- Record Components:
json- the JSON text of the event frame (already escaped; nevernull)delayMillis- milliseconds to wait before sending this frame (0 = immediate)
A single scripted realtime WebSocket event: the fully-rendered JSON text frame the mock will send to the
client, plus the delay (milliseconds) to wait before sending it. The codecs are pure and produce an ordered
List<RealtimeEvent>; the client-side builder maps each one onto a
WebSocketMessage carrying the same delay.-
Constructor Summary
ConstructorsConstructorDescriptionRealtimeEvent(String json, long delayMillis) Creates an instance of aRealtimeEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic RealtimeEventlongReturns the value of thedelayMillisrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static RealtimeEventjson()Returns the value of thejsonrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RealtimeEvent
Creates an instance of aRealtimeEventrecord class.- Parameters:
json- the value for thejsonrecord componentdelayMillis- the value for thedelayMillisrecord component
-
-
Method Details
-
immediate
-
delayed
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
json
Returns the value of thejsonrecord component.- Returns:
- the value of the
jsonrecord component
-
delayMillis
public long delayMillis()Returns the value of thedelayMillisrecord component.- Returns:
- the value of the
delayMillisrecord component
-