Package com.tnsai.fsm
Record Class StateMachineContext.StateTransitionRecord
java.lang.Object
java.lang.Record
com.tnsai.fsm.StateMachineContext.StateTransitionRecord
- Enclosing class:
StateMachineContext
public static record StateMachineContext.StateTransitionRecord(String fromState, String toState, String event, long timestamp)
extends Record
Record of a state transition.
-
Constructor Summary
ConstructorsConstructorDescriptionStateTransitionRecord(String fromState, String toState, String event, long timestamp) Creates an instance of aStateTransitionRecordrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.event()Returns the value of theeventrecord component.Returns the value of thefromStaterecord component.final inthashCode()Returns a hash code value for this object.longReturns the value of thetimestamprecord component.toState()Returns the value of thetoStaterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StateTransitionRecord
Creates an instance of aStateTransitionRecordrecord class.- Parameters:
fromState- the value for thefromStaterecord componenttoState- the value for thetoStaterecord componentevent- the value for theeventrecord componenttimestamp- the value for thetimestamprecord component
-
-
Method Details
-
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 '=='. -
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
-
event
Returns the value of theeventrecord component.- Returns:
- the value of the
eventrecord component
-
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-