Package io.karatelabs.core
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 Summary
ConstructorsConstructorDescriptionStepRunEvent(RunEventType type, Step step, ScenarioRuntime scenarioRuntime, StepResult result, long timeStamp) Creates an instance of aStepRunEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic StepRunEvententer(Step step, ScenarioRuntime sr) final booleanIndicates whether some other object is "equal to" this one.static StepRunEventexit(StepResult result, ScenarioRuntime sr) longReturns the timestamp when this event occurred (epoch milliseconds).getType()Returns the event type.final inthashCode()Returns a hash code value for this object.result()Returns the value of theresultrecord component.Returns the value of thescenarioRuntimerecord component.step()Returns the value of thesteprecord component.longReturns the value of thetimeStamprecord component.toJson()Serializes this event to a map for JSONL output.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
StepRunEvent
public StepRunEvent(RunEventType type, Step step, ScenarioRuntime scenarioRuntime, StepResult result, long timeStamp) Creates an instance of aStepRunEventrecord class.- Parameters:
type- the value for thetyperecord componentstep- the value for thesteprecord componentscenarioRuntime- the value for thescenarioRuntimerecord componentresult- the value for theresultrecord componenttimeStamp- the value for thetimeStamprecord component
-
-
Method Details
-
enter
-
exit
-
getType
Description copied from interface:RunEventReturns the event type. -
getTimeStamp
public long getTimeStamp()Description copied from interface:RunEventReturns the timestamp when this event occurred (epoch milliseconds).- Specified by:
getTimeStampin interfaceRunEvent
-
toJson
Description copied from interface:RunEventSerializes this event to a map for JSONL output. -
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 '=='. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
step
Returns the value of thesteprecord component.- Returns:
- the value of the
steprecord component
-
scenarioRuntime
Returns the value of thescenarioRuntimerecord component.- Returns:
- the value of the
scenarioRuntimerecord component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
timeStamp
public long timeStamp()Returns the value of thetimeStamprecord component.- Returns:
- the value of the
timeStamprecord component
-