Record Class ProgressItem
java.lang.Object
java.lang.Record
com.amalgamasimulation.studies.headlessapp.dto.ProgressItem
public record ProgressItem(ShortId runId, double completedFraction, Run.Status status, boolean cancelledBeforeStart)
extends Record
A task execution status reported by a console application to Amalgama Cloud Runner.
completedFraction denotes the simulation progress, where 0.0
means 0 % complete, and 1.0 means 100 % complete.
When the
status is NOT_STARTED, the
completedFraction is 0.0.
After the status changes
to IN_PROGRESS, the completedFraction starts to
grow.
-
Constructor Summary
ConstructorsConstructorDescriptionProgressItem(ShortId runId, double completedFraction, Run.Status status, boolean cancelledBeforeStart) Creates an instance of aProgressItemrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecancelledBeforeStartrecord component.doubleReturns the value of thecompletedFractionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.runId()Returns the value of therunIdrecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ProgressItem
public ProgressItem(ShortId runId, double completedFraction, Run.Status status, boolean cancelledBeforeStart) Creates an instance of aProgressItemrecord class.- Parameters:
runId- the value for therunIdrecord componentcompletedFraction- the value for thecompletedFractionrecord componentstatus- the value for thestatusrecord componentcancelledBeforeStart- the value for thecancelledBeforeStartrecord component
-
-
Method Details
-
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 '=='. -
runId
Returns the value of therunIdrecord component.- Returns:
- the value of the
runIdrecord component
-
completedFraction
public double completedFraction()Returns the value of thecompletedFractionrecord component.- Returns:
- the value of the
completedFractionrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
cancelledBeforeStart
public boolean cancelledBeforeStart()Returns the value of thecancelledBeforeStartrecord component.- Returns:
- the value of the
cancelledBeforeStartrecord component
-