Record Class MissionTracker.MissionProgress
java.lang.Object
java.lang.Record
com.tnsai.coordination.groups.team.MissionTracker.MissionProgress
- Enclosing class:
MissionTracker
public static record MissionTracker.MissionProgress(String mission, MissionTracker.MissionStatus status, int tasksTotal, int tasksCompleted, int tasksFailed, int tasksPending, double successRate, Duration elapsed, Instant startedAt, Instant completedAt)
extends Record
Mission progress snapshot.
-
Constructor Summary
ConstructorsConstructorDescriptionMissionProgress(String mission, MissionTracker.MissionStatus status, int tasksTotal, int tasksCompleted, int tasksFailed, int tasksPending, double successRate, Duration elapsed, Instant startedAt, Instant completedAt) Creates an instance of aMissionProgressrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecompletedAtrecord component.elapsed()Returns the value of theelapsedrecord component.final booleanIndicates whether some other object is "equal to" this one.doublefinal inthashCode()Returns a hash code value for this object.booleanmission()Returns the value of themissionrecord component.Returns the value of thestartedAtrecord component.status()Returns the value of thestatusrecord component.doubleReturns the value of thesuccessRaterecord component.intReturns the value of thetasksCompletedrecord component.intReturns the value of thetasksFailedrecord component.intReturns the value of thetasksPendingrecord component.intReturns the value of thetasksTotalrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MissionProgress
public MissionProgress(String mission, MissionTracker.MissionStatus status, int tasksTotal, int tasksCompleted, int tasksFailed, int tasksPending, double successRate, Duration elapsed, Instant startedAt, Instant completedAt) Creates an instance of aMissionProgressrecord class.- Parameters:
mission- the value for themissionrecord componentstatus- the value for thestatusrecord componenttasksTotal- the value for thetasksTotalrecord componenttasksCompleted- the value for thetasksCompletedrecord componenttasksFailed- the value for thetasksFailedrecord componenttasksPending- the value for thetasksPendingrecord componentsuccessRate- the value for thesuccessRaterecord componentelapsed- the value for theelapsedrecord componentstartedAt- the value for thestartedAtrecord componentcompletedAt- the value for thecompletedAtrecord component
-
-
Method Details
-
isComplete
public boolean isComplete() -
getCompletionPercentage
public double getCompletionPercentage() -
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 '=='. -
mission
Returns the value of themissionrecord component.- Returns:
- the value of the
missionrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
tasksTotal
public int tasksTotal()Returns the value of thetasksTotalrecord component.- Returns:
- the value of the
tasksTotalrecord component
-
tasksCompleted
public int tasksCompleted()Returns the value of thetasksCompletedrecord component.- Returns:
- the value of the
tasksCompletedrecord component
-
tasksFailed
public int tasksFailed()Returns the value of thetasksFailedrecord component.- Returns:
- the value of the
tasksFailedrecord component
-
tasksPending
public int tasksPending()Returns the value of thetasksPendingrecord component.- Returns:
- the value of the
tasksPendingrecord component
-
successRate
public double successRate()Returns the value of thesuccessRaterecord component.- Returns:
- the value of the
successRaterecord component
-
elapsed
Returns the value of theelapsedrecord component.- Returns:
- the value of the
elapsedrecord component
-
startedAt
Returns the value of thestartedAtrecord component.- Returns:
- the value of the
startedAtrecord component
-
completedAt
Returns the value of thecompletedAtrecord component.- Returns:
- the value of the
completedAtrecord component
-