Record Class StepRunEvent

java.lang.Object
java.lang.Record
io.karatelabs.core.StepRunEvent
All Implemented Interfaces:
RunEvent

public record StepRunEvent(RunEventType type, Step step, ScenarioRuntime scenarioRuntime, StepResult result, long timeStamp) extends Record implements RunEvent
Step-level events (STEP_ENTER, STEP_EXIT).
  • Constructor Details

    • StepRunEvent

      public StepRunEvent(RunEventType type, Step step, ScenarioRuntime scenarioRuntime, StepResult result, long timeStamp)
      Creates an instance of a StepRunEvent record class.
      Parameters:
      type - the value for the type record component
      step - the value for the step record component
      scenarioRuntime - the value for the scenarioRuntime record component
      result - the value for the result record component
      timeStamp - the value for the timeStamp record component
  • Method Details

    • enter

      public static StepRunEvent enter(Step step, ScenarioRuntime sr)
    • exit

      public static StepRunEvent exit(StepResult result, ScenarioRuntime sr)
    • getType

      public RunEventType getType()
      Description copied from interface: RunEvent
      Returns the event type.
      Specified by:
      getType in interface RunEvent
    • getTimeStamp

      public long getTimeStamp()
      Description copied from interface: RunEvent
      Returns the timestamp when this event occurred (epoch milliseconds).
      Specified by:
      getTimeStamp in interface RunEvent
    • toJson

      public Map<String,Object> toJson()
      Description copied from interface: RunEvent
      Serializes this event to a map for JSONL output.
      Specified by:
      toJson in interface RunEvent
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • type

      public RunEventType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • step

      public Step step()
      Returns the value of the step record component.
      Returns:
      the value of the step record component
    • scenarioRuntime

      public ScenarioRuntime scenarioRuntime()
      Returns the value of the scenarioRuntime record component.
      Returns:
      the value of the scenarioRuntime record component
    • result

      public StepResult result()
      Returns the value of the result record component.
      Returns:
      the value of the result record component
    • timeStamp

      public long timeStamp()
      Returns the value of the timeStamp record component.
      Returns:
      the value of the timeStamp record component