Class WorkflowDefinitionId

java.lang.Object
com.yworkflow.definition.model.value.WorkflowDefinitionId
All Implemented Interfaces:
ModelId, Comparable<WorkflowDefinitionId>

public class WorkflowDefinitionId extends Object implements ModelId, Comparable<WorkflowDefinitionId>
Represents a unique identifier for a workflow definition. WorkflowDefinitionId is an immutable value object that serves as the primary key for workflow definitions within the yWorkflow engine.

WorkflowDefinitionId instances are created using the workflowDefinitionId(String) factory method, which validates the input string to ensure it meets the requirements for workflow IDs.

Since:
1.0
See Also:
  • Method Details

    • getValue

      public String getValue()
      Returns the string value of this workflow definition ID.
      Specified by:
      getValue in interface ModelId
      Returns:
      the workflow definition ID value
    • workflowDefinitionId

      public static WorkflowDefinitionId workflowDefinitionId(String value)
      Creates a new WorkflowDefinitionId instance with the specified value. The value is validated to ensure it meets the requirements for workflow definition IDs.
      Parameters:
      value - the string value for the workflow definition ID
      Returns:
      a new WorkflowDefinitionId instance
      Throws:
      IllegalArgumentException - if the value is invalid
    • compareTo

      public int compareTo(WorkflowDefinitionId workflowDefinitionId)
      Compares this WorkflowDefinitionId with another WorkflowDefinitionId for ordering. Comparison is based on the string value of the workflow definition ID.
      Specified by:
      compareTo in interface Comparable<WorkflowDefinitionId>
      Parameters:
      workflowDefinitionId - the WorkflowDefinitionId to compare with
      Returns:
      a negative integer, zero, or a positive integer as this WorkflowDefinitionId is less than, equal to, or greater than the specified WorkflowDefinitionId
    • equals

      public boolean equals(Object object)
      Compares this WorkflowDefinitionId with the specified object for equality. Two WorkflowDefinitionId instances are equal if they have the same value.
      Overrides:
      equals in class Object
      Parameters:
      object - the object to compare with
      Returns:
      true if the objects are equal, false otherwise
    • hashCode

      public int hashCode()
      Returns the hash code for this WorkflowDefinitionId.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code
    • toString

      public String toString()
      Returns a string representation of this WorkflowDefinitionId.
      Overrides:
      toString in class Object
      Returns:
      the string representation