Record Class ChoreographyEventBus.ChoreographyEvent
java.lang.Object
java.lang.Record
com.tnsai.coordination.choreography.ChoreographyEventBus.ChoreographyEvent
- Record Components:
eventName- the event topic/namesourceAgent- agent that published this eventpayload- event payload (may be empty)timestamp- epoch millis when the event was created
- Enclosing class:
ChoreographyEventBus
public static record ChoreographyEventBus.ChoreographyEvent(String eventName, String sourceAgent, String payload, long timestamp)
extends Record
An event published on the choreography bus.
-
Constructor Summary
ConstructorsConstructorDescriptionChoreographyEvent(String eventName, String sourceAgent, String payload, long timestamp) Creates an instance of aChoreographyEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theeventNamerecord component.final inthashCode()Returns a hash code value for this object.payload()Returns the value of thepayloadrecord component.Returns the value of thesourceAgentrecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ChoreographyEvent
Creates an instance of aChoreographyEventrecord class.- Parameters:
eventName- the value for theeventNamerecord componentsourceAgent- the value for thesourceAgentrecord componentpayload- the value for thepayloadrecord componenttimestamp- the value for thetimestamprecord component
-
-
Method Details
-
of
public static ChoreographyEventBus.ChoreographyEvent of(String eventName, String sourceAgent, String payload) -
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 '=='. -
eventName
Returns the value of theeventNamerecord component.- Returns:
- the value of the
eventNamerecord component
-
sourceAgent
Returns the value of thesourceAgentrecord component.- Returns:
- the value of the
sourceAgentrecord component
-
payload
Returns the value of thepayloadrecord component.- Returns:
- the value of the
payloadrecord component
-
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-