Record Class HierarchicalResult

java.lang.Object
java.lang.Record
com.tnsai.coordination.hierarchical.HierarchicalResult
Record Components:
rootTaskId - The root task ID
result - The aggregated result
status - The execution status
tacticalTaskCount - Number of tactical tasks created
operationalTaskCount - Number of operational tasks executed
duration - Total execution duration
taskTree - 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
  • 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 a HierarchicalResult record class.
      Parameters:
      rootTaskId - the value for the rootTaskId record component
      result - the value for the result record component
      status - the value for the status record component
      tacticalTaskCount - the value for the tacticalTaskCount record component
      operationalTaskCount - the value for the operationalTaskCount record component
      duration - the value for the duration record component
      taskTree - the value for the taskTree record 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • rootTaskId

      public String rootTaskId()
      Returns the value of the rootTaskId record component.
      Returns:
      the value of the rootTaskId record component
    • result

      public String result()
      Returns the value of the result record component.
      Returns:
      the value of the result record component
    • status

      public HierarchicalResult.Status status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • tacticalTaskCount

      public int tacticalTaskCount()
      Returns the value of the tacticalTaskCount record component.
      Returns:
      the value of the tacticalTaskCount record component
    • operationalTaskCount

      public int operationalTaskCount()
      Returns the value of the operationalTaskCount record component.
      Returns:
      the value of the operationalTaskCount record component
    • duration

      public Duration duration()
      Returns the value of the duration record component.
      Returns:
      the value of the duration record component
    • taskTree

      public Map<String,Object> taskTree()
      Returns the value of the taskTree record component.
      Returns:
      the value of the taskTree record component