Class StateInstanceId

java.lang.Object
com.yworkflow.instance.model.value.StateInstanceId
All Implemented Interfaces:
Comparable<StateInstanceId>

public class StateInstanceId extends Object implements Comparable<StateInstanceId>
Immutable value object representing a unique identifier for a workflow state instance. StateInstanceId provides type-safe identification of state instances within workflow executions, ensuring proper tracking and management of individual state instances.
Since:
1.0
See Also:
  • Field Details

    • EMPTY

      public static final StateInstanceId EMPTY
      Empty state instance ID with no value.
  • Method Details

    • getValue

      public String getValue()
      Gets the string value of this state instance ID.
      Returns:
      the ID value as a string
    • stateInstanceId

      public static StateInstanceId stateInstanceId(String value)
      Creates a new StateInstanceId with the specified value.
      Parameters:
      value - the state instance ID value
      Returns:
      a new StateInstanceId instance
      Throws:
      IllegalArgumentException - if the value is null or empty
    • compareTo

      public int compareTo(StateInstanceId o)
      Specified by:
      compareTo in interface Comparable<StateInstanceId>
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • asLong

      public Long asLong()
      Converts this state instance ID to a Long value.
      Returns:
      the Long representation of this ID
      Throws:
      NumberFormatException - if the ID value is not a valid Long