Record Class TaskListResult

java.lang.Object
java.lang.Record
com.tnsai.planning.tasklist.TaskListResult
Record Components:
taskListName - the name of the executed task list
results - per-task results
completedCount - number of completed tasks
totalCount - total number of tasks
totalDuration - total execution duration

public record TaskListResult(String taskListName, List<com.tnsai.planning.tasklist.TaskResult> results, int completedCount, int totalCount, Duration totalDuration) extends Record
Result of executing a complete task list.
Author:
TnsAI Team
  • Constructor Details

    • TaskListResult

      public TaskListResult(String taskListName, List<com.tnsai.planning.tasklist.TaskResult> results, int completedCount, int totalCount, Duration totalDuration)
      Creates an instance of a TaskListResult record class.
      Parameters:
      taskListName - the value for the taskListName record component
      results - the value for the results record component
      completedCount - the value for the completedCount record component
      totalCount - the value for the totalCount record component
      totalDuration - the value for the totalDuration record component
  • Method Details

    • isAllCompleted

      public boolean isAllCompleted()
      Returns true if all tasks completed successfully.
    • completionRate

      public double completionRate()
      Returns the completion rate as a percentage (0.0 to 1.0).
    • 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.
    • taskListName

      public String taskListName()
      Returns the value of the taskListName record component.
      Returns:
      the value of the taskListName record component
    • results

      public List<com.tnsai.planning.tasklist.TaskResult> results()
      Returns the value of the results record component.
      Returns:
      the value of the results record component
    • completedCount

      public int completedCount()
      Returns the value of the completedCount record component.
      Returns:
      the value of the completedCount record component
    • totalCount

      public int totalCount()
      Returns the value of the totalCount record component.
      Returns:
      the value of the totalCount record component
    • totalDuration

      public Duration totalDuration()
      Returns the value of the totalDuration record component.
      Returns:
      the value of the totalDuration record component