Record Class FsmLogContext<S extends Enum<S>>

java.lang.Object
java.lang.Record
io.hektor.fsm.impl.FsmLogContext<S>
All Implemented Interfaces:
io.snice.logging.Context

public record FsmLogContext<S extends Enum<S>>(String friendlyName, Object uuid, S extends Enum<S> currentState, S extends Enum<S> nextState, Object event) extends Record implements io.snice.logging.Context
  • Constructor Details

    • FsmLogContext

      public FsmLogContext(String friendlyName, Object uuid)
    • FsmLogContext

      public FsmLogContext(String friendlyName, Object uuid, S currentState, S nextState, Object event)
      Creates an instance of a FsmLogContext record class.
      Parameters:
      friendlyName - the value for the friendlyName record component
      uuid - the value for the uuid record component
      currentState - the value for the currentState record component
      nextState - the value for the nextState record component
      event - the value for the event record component
  • Method Details

    • transition

      public FsmLogContext transition(S currentState, S nextState, Object event)
    • unhandledEvent

      public FsmLogContext unhandledEvent(S currentState, Object event)
    • copyContext

      public void copyContext(BiConsumer<String,String> visitor)
      Specified by:
      copyContext in interface io.snice.logging.Context
    • format

      public static String format(Object object)
      TODO: should probably allow to pass in their own formatting logic.
    • 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.
    • friendlyName

      public String friendlyName()
      Returns the value of the friendlyName record component.
      Returns:
      the value of the friendlyName record component
    • uuid

      public Object uuid()
      Returns the value of the uuid record component.
      Returns:
      the value of the uuid record component
    • currentState

      public S currentState()
      Returns the value of the currentState record component.
      Returns:
      the value of the currentState record component
    • nextState

      public S nextState()
      Returns the value of the nextState record component.
      Returns:
      the value of the nextState record component
    • event

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