Record Class HierarchicalTask
java.lang.Object
java.lang.Record
com.tnsai.coordination.hierarchical.HierarchicalTask
public record HierarchicalTask(String taskId, String parentTaskId, HierarchyLevel level, String description, Map<String,Object> context, HierarchicalTask.TaskStatus status, List<String> subtaskIds, String result, Instant createdAt, Instant completedAt)
extends Record
A task within the hierarchical orchestration system.
Tasks flow from Strategic to Tactical to Operational layers, with each layer refining and decomposing the task further.
- Since:
- 0.1.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionHierarchicalTask(String taskId, String parentTaskId, HierarchyLevel level, String description, Map<String, Object> context, HierarchicalTask.TaskStatus status, List<String> subtaskIds, String result, Instant createdAt, Instant completedAt) Creates an instance of aHierarchicalTaskrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecompletedAtrecord component.context()Returns the value of thecontextrecord component.Returns the value of thecreatedAtrecord component.createOperationalSubtask(String description, Map<String, Object> additionalContext) Creates an operational subtask from this task.createTacticalSubtask(String description, Map<String, Object> additionalContext) Creates a tactical subtask from this task.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.level()Returns the value of thelevelrecord component.Returns the value of theparentTaskIdrecord component.result()Returns the value of theresultrecord component.status()Returns the value of thestatusrecord component.static HierarchicalTaskCreates a new strategic-level task.Returns the value of thesubtaskIdsrecord component.taskId()Returns the value of thetaskIdrecord component.final StringtoString()Returns a string representation of this record class.withResult(String result) Returns a copy with result.withStatus(HierarchicalTask.TaskStatus newStatus) Returns a copy with updated status.withSubtasks(List<String> subtaskIds) Returns a copy with subtask IDs.
-
Constructor Details
-
HierarchicalTask
public HierarchicalTask(String taskId, String parentTaskId, HierarchyLevel level, String description, Map<String, Object> context, HierarchicalTask.TaskStatus status, List<String> subtaskIds, String result, Instant createdAt, Instant completedAt) Creates an instance of aHierarchicalTaskrecord class.- Parameters:
taskId- the value for thetaskIdrecord componentparentTaskId- the value for theparentTaskIdrecord componentlevel- the value for thelevelrecord componentdescription- the value for thedescriptionrecord componentcontext- the value for thecontextrecord componentstatus- the value for thestatusrecord componentsubtaskIds- the value for thesubtaskIdsrecord componentresult- the value for theresultrecord componentcreatedAt- the value for thecreatedAtrecord componentcompletedAt- the value for thecompletedAtrecord component
-
-
Method Details
-
strategic
Creates a new strategic-level task. -
createTacticalSubtask
public HierarchicalTask createTacticalSubtask(String description, Map<String, Object> additionalContext) Creates a tactical subtask from this task. -
createOperationalSubtask
public HierarchicalTask createOperationalSubtask(String description, Map<String, Object> additionalContext) Creates an operational subtask from this task. -
withStatus
Returns a copy with updated status. -
withResult
Returns a copy with result. -
withSubtasks
Returns a copy with subtask IDs. -
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
taskId
Returns the value of thetaskIdrecord component.- Returns:
- the value of the
taskIdrecord component
-
parentTaskId
Returns the value of theparentTaskIdrecord component.- Returns:
- the value of the
parentTaskIdrecord component
-
level
Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
context
Returns the value of thecontextrecord component.- Returns:
- the value of the
contextrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
subtaskIds
Returns the value of thesubtaskIdsrecord component.- Returns:
- the value of the
subtaskIdsrecord component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
createdAt
Returns the value of thecreatedAtrecord component.- Returns:
- the value of the
createdAtrecord component
-
completedAt
Returns the value of thecompletedAtrecord component.- Returns:
- the value of the
completedAtrecord component
-