Class ForkId
java.lang.Object
com.yworkflow.definition.model.value.ForkId
- All Implemented Interfaces:
DestinationId,ModelId
Represents a unique identifier for a workflow fork. ForkId is an immutable value object that
identifies a specific fork operation within a workflow definition.
ForkId implements the DestinationId interface, making it suitable for use as a destination in workflow transitions. It supports both a value (required) and an optional name for human-readable identification.
Forks are used to split a workflow into multiple parallel paths, allowing multiple activities to be executed simultaneously. Each fork must have a unique identifier within the workflow definition.
- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this ForkId with another object for equality.static ForkIdCreates a new ForkId with the specified value and no name.static ForkIdCreates a new ForkId with the specified value and name.getName()Returns the optional human-readable name of this fork.getValue()Returns the string value of this fork ID.inthashCode()Returns the hash code for this ForkId based on its string value.booleanisForkId()Returns true since this is a ForkId.Creates a new ForkId with the same value but a different name.toString()Returns a string representation of this ForkId.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.yworkflow.definition.model.value.DestinationId
isJoinId, isStateId
-
Method Details
-
getValue
Returns the string value of this fork ID.- Specified by:
getValuein interfaceDestinationId- Specified by:
getValuein interfaceModelId- Returns:
- the fork identifier string
-
getName
Returns the optional human-readable name of this fork.- Specified by:
getNamein interfaceDestinationId- Returns:
- an Optional containing the name if present, empty otherwise
-
isForkId
public boolean isForkId()Returns true since this is a ForkId.- Specified by:
isForkIdin interfaceDestinationId- Returns:
- always true
-
forkId
Creates a new ForkId with the specified value and no name.- Parameters:
value- the fork identifier string- Returns:
- a new ForkId instance
- Throws:
IllegalArgumentException- if the value is invalid
-
forkId
Creates a new ForkId with the specified value and name.- Parameters:
value- the fork identifier stringname- the optional human-readable name- Returns:
- a new ForkId instance
- Throws:
IllegalArgumentException- if the value is invalid
-
name
Creates a new ForkId with the same value but a different name.- Parameters:
name- the new name for this fork ID- Returns:
- a new ForkId instance with the specified name
-
equals
Compares this ForkId with another object for equality. Two ForkId instances are equal if they have the same string value. -
hashCode
public int hashCode()Returns the hash code for this ForkId based on its string value. -
toString
Returns a string representation of this ForkId.
-