Package dev.agenor.core.dialogue
Record Class CommitmentEvent
java.lang.Object
java.lang.Record
dev.agenor.core.dialogue.CommitmentEvent
- Record Components:
timestamp- when the transition occurredfromState- the previous statetoState- the new statetriggeredBy- the agent or message that triggered the transitiondescription- optional description of the transition
public record CommitmentEvent(Instant timestamp, CommitmentState fromState, CommitmentState toState, String triggeredBy, String description)
extends Record
Records a state transition in a commitment's lifecycle.
- Since:
- 0.5.0
-
Constructor Summary
ConstructorsConstructorDescriptionCommitmentEvent(Instant timestamp, CommitmentState fromState, CommitmentState toState, String triggeredBy, String description) Creates an instance of aCommitmentEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic CommitmentEventCreates an activation event.static CommitmentEventCreates an event for the initial commitment creation.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefromStaterecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thetimestamprecord component.toState()Returns the value of thetoStaterecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetriggeredByrecord component.
-
Constructor Details
-
CommitmentEvent
public CommitmentEvent(Instant timestamp, CommitmentState fromState, CommitmentState toState, String triggeredBy, String description) Creates an instance of aCommitmentEventrecord class.- Parameters:
timestamp- the value for thetimestamprecord componentfromState- the value for thefromStaterecord componenttoState- the value for thetoStaterecord componenttriggeredBy- the value for thetriggeredByrecord componentdescription- the value for thedescriptionrecord component
-
-
Method Details
-
created
Creates an event for the initial commitment creation. -
activated
Creates an activation event. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
fromState
Returns the value of thefromStaterecord component.- Returns:
- the value of the
fromStaterecord component
-
toState
Returns the value of thetoStaterecord component.- Returns:
- the value of the
toStaterecord component
-
triggeredBy
Returns the value of thetriggeredByrecord component.- Returns:
- the value of the
triggeredByrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-