Package com.tnsai.planning.tasklist
Record Class TaskListResult
java.lang.Object
java.lang.Record
com.tnsai.planning.tasklist.TaskListResult
- Record Components:
taskListName- the name of the executed task listresults- per-task resultscompletedCount- number of completed taskstotalCount- total number of taskstotalDuration- 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 Summary
ConstructorsConstructorDescriptionTaskListResult(String taskListName, List<com.tnsai.planning.tasklist.TaskResult> results, int completedCount, int totalCount, Duration totalDuration) Creates an instance of aTaskListResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecompletedCountrecord component.doubleReturns the completion rate as a percentage (0.0 to 1.0).final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns true if all tasks completed successfully.List<com.tnsai.planning.tasklist.TaskResult> results()Returns the value of theresultsrecord component.Returns the value of thetaskListNamerecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalCountrecord component.Returns the value of thetotalDurationrecord component.
-
Constructor Details
-
TaskListResult
public TaskListResult(String taskListName, List<com.tnsai.planning.tasklist.TaskResult> results, int completedCount, int totalCount, Duration totalDuration) Creates an instance of aTaskListResultrecord class.- Parameters:
taskListName- the value for thetaskListNamerecord componentresults- the value for theresultsrecord componentcompletedCount- the value for thecompletedCountrecord componenttotalCount- the value for thetotalCountrecord componenttotalDuration- the value for thetotalDurationrecord 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
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 '=='. -
taskListName
Returns the value of thetaskListNamerecord component.- Returns:
- the value of the
taskListNamerecord component
-
results
Returns the value of theresultsrecord component.- Returns:
- the value of the
resultsrecord component
-
completedCount
public int completedCount()Returns the value of thecompletedCountrecord component.- Returns:
- the value of the
completedCountrecord component
-
totalCount
public int totalCount()Returns the value of thetotalCountrecord component.- Returns:
- the value of the
totalCountrecord component
-
totalDuration
Returns the value of thetotalDurationrecord component.- Returns:
- the value of the
totalDurationrecord component
-