Record Class HierarchicalResult
java.lang.Object
java.lang.Record
com.tnsai.coordination.hierarchical.HierarchicalResult
- Record Components:
rootTaskId- The root task IDresult- The aggregated resultstatus- The execution statustacticalTaskCount- Number of tactical tasks createdoperationalTaskCount- Number of operational tasks executedduration- Total execution durationtaskTree- Hierarchical task tree
public record HierarchicalResult(String rootTaskId, String result, HierarchicalResult.Status status, int tacticalTaskCount, int operationalTaskCount, Duration duration, Map<String,Object> taskTree)
extends Record
Result of a hierarchical orchestration execution.
- Since:
- 0.1.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionHierarchicalResult(String rootTaskId, String result, HierarchicalResult.Status status, int tacticalTaskCount, int operationalTaskCount, Duration duration, Map<String, Object> taskTree) Creates an instance of aHierarchicalResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionduration()Returns the value of thedurationrecord component.longGets duration in milliseconds.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanWhether the execution was successful.intReturns the value of theoperationalTaskCountrecord component.result()Returns the value of theresultrecord component.Returns the value of therootTaskIdrecord component.status()Returns the value of thestatusrecord component.intReturns the value of thetacticalTaskCountrecord component.taskTree()Returns the value of thetaskTreerecord component.final StringtoString()Returns a string representation of this record class.intGets the total task count (tactical + operational).
-
Constructor Details
-
HierarchicalResult
public HierarchicalResult(String rootTaskId, String result, HierarchicalResult.Status status, int tacticalTaskCount, int operationalTaskCount, Duration duration, Map<String, Object> taskTree) Creates an instance of aHierarchicalResultrecord class.- Parameters:
rootTaskId- the value for therootTaskIdrecord componentresult- the value for theresultrecord componentstatus- the value for thestatusrecord componenttacticalTaskCount- the value for thetacticalTaskCountrecord componentoperationalTaskCount- the value for theoperationalTaskCountrecord componentduration- the value for thedurationrecord componenttaskTree- the value for thetaskTreerecord component
-
-
Method Details
-
isSuccess
public boolean isSuccess()Whether the execution was successful. -
totalTaskCount
public int totalTaskCount()Gets the total task count (tactical + operational). -
durationMillis
public long durationMillis()Gets duration in milliseconds. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
rootTaskId
Returns the value of therootTaskIdrecord component.- Returns:
- the value of the
rootTaskIdrecord component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
tacticalTaskCount
public int tacticalTaskCount()Returns the value of thetacticalTaskCountrecord component.- Returns:
- the value of the
tacticalTaskCountrecord component
-
operationalTaskCount
public int operationalTaskCount()Returns the value of theoperationalTaskCountrecord component.- Returns:
- the value of the
operationalTaskCountrecord component
-
duration
Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-
taskTree
Returns the value of thetaskTreerecord component.- Returns:
- the value of the
taskTreerecord component
-