Record Class GracefulShutdownCoordinator.ShutdownProgress
java.lang.Object
java.lang.Record
com.loomcache.server.lifecycle.GracefulShutdownCoordinator.ShutdownProgress
- Record Components:
phase- the current shutdown phasecompletedSteps- the number of steps completed in the current phasetotalSteps- the total number of steps in the current phaseelapsed- the duration elapsed since shutdown started
- Enclosing class:
GracefulShutdownCoordinator
public static record GracefulShutdownCoordinator.ShutdownProgress(GracefulShutdownCoordinator.ShutdownPhase phase, int completedSteps, int totalSteps, Duration elapsed)
extends Record
Record representing the current progress of shutdown.
-
Constructor Summary
ConstructorsConstructorDescriptionShutdownProgress(GracefulShutdownCoordinator.ShutdownPhase phase, int completedSteps, int totalSteps, Duration elapsed) Creates an instance of aShutdownProgressrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecompletedStepsrecord component.elapsed()Returns the value of theelapsedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.phase()Returns the value of thephaserecord component.intReturns the progress as a percentage (0-100).final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalStepsrecord component.
-
Constructor Details
-
ShutdownProgress
public ShutdownProgress(GracefulShutdownCoordinator.ShutdownPhase phase, int completedSteps, int totalSteps, Duration elapsed) Creates an instance of aShutdownProgressrecord class.- Parameters:
phase- the value for thephaserecord componentcompletedSteps- the value for thecompletedStepsrecord componenttotalSteps- the value for thetotalStepsrecord componentelapsed- the value for theelapsedrecord component
-
-
Method Details
-
progressPercent
public int progressPercent()Returns the progress as a percentage (0-100).- Returns:
- progress percentage
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
phase
-
completedSteps
public int completedSteps()Returns the value of thecompletedStepsrecord component.- Returns:
- the value of the
completedStepsrecord component
-
totalSteps
public int totalSteps()Returns the value of thetotalStepsrecord component.- Returns:
- the value of the
totalStepsrecord component
-
elapsed
-