Record Class ProcessTransition<S extends Enum<S> & ProcessStepKey>

java.lang.Object
java.lang.Record
su.onno.process.ProcessTransition<S>
Record Components:
from - source step, or null for process start
to - target step
outcome - completed task outcome, or null for process start

public record ProcessTransition<S extends Enum<S> & ProcessStepKey>(S extends Enum<S> & ProcessStepKey from, S extends Enum<S> & ProcessStepKey to, Enum<?> outcome, Instant occurredAt) extends Record
One recorded process transition.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProcessTransition(S from, S to, Enum<?> outcome, Instant occurredAt)
    Creates an instance of a ProcessTransition record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the from record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the occurredAt record component.
    Enum<?>
    Returns the value of the outcome record component.
    to()
    Returns the value of the to record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ProcessTransition

      public ProcessTransition(S from, S to, Enum<?> outcome, Instant occurredAt)
      Creates an instance of a ProcessTransition record class.
      Parameters:
      from - the value for the from record component
      to - the value for the to record component
      outcome - the value for the outcome record component
      occurredAt - the value for the occurredAt record component
  • Method Details

    • 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.
    • from

      public S from()
      Returns the value of the from record component.
      Returns:
      the value of the from record component
    • to

      public S to()
      Returns the value of the to record component.
      Returns:
      the value of the to record component
    • outcome

      public Enum<?> outcome()
      Returns the value of the outcome record component.
      Returns:
      the value of the outcome record component
    • occurredAt

      public Instant occurredAt()
      Returns the value of the occurredAt record component.
      Returns:
      the value of the occurredAt record component