Record Class PublishStepDefinition

java.lang.Object
java.lang.Record
io.axoniq.framework.workflow.dsl.api.PublishStepDefinition
Record Components:
stepName - logical step name recorded with the published event
event - event to publish

public record PublishStepDefinition(String stepName, EventMessage event) extends Record
Specification for a ctx.publish(stepName, event) call.

Unlike the other step definitions this one carries no PrimitiveMetadata: the published event keeps its own MessageType, so there is no event name to customize. Only the step name is needed.

Since:
5.4.0
Author:
Stefan Dragisic
  • Constructor Details

    • PublishStepDefinition

      public PublishStepDefinition(String stepName, EventMessage event)
      Fails fast when a mandatory component is null; the package's null-marked contract alone is not enforced at runtime, so a user ignoring it is detected here at construction.
  • Method Details

    • stepName

      public PublishStepDefinition stepName(String stepName)
      Returns a copy of this definition with the provided step name.
      Parameters:
      stepName - logical step name
      Returns:
      copied definition
    • event

      public PublishStepDefinition event(EventMessage event)
      Returns a copy of this definition with the provided event.
      Parameters:
      event - event to publish
      Returns:
      copied definition
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • stepName

      public String stepName()
      Returns the value of the stepName record component.
      Returns:
      the value of the stepName record component
    • event

      public EventMessage event()
      Returns the value of the event record component.
      Returns:
      the value of the event record component