Package me.hsgamer.hscore.crontime
Class CronTimeManager
java.lang.Object
me.hsgamer.hscore.crontime.CronTimeManager
A simple cron-time manager to manage next execution time
-
Constructor Summary
ConstructorsConstructorDescriptionCronTimeManager(@NotNull com.cronutils.model.Cron... crons) Create a new managerCronTimeManager(@NotNull List<com.cronutils.model.Cron> cronList) Create a new manager -
Method Summary
Modifier and TypeMethodDescription@NotNull List<com.cronutils.model.Cron> Get the cron listlongGet the next epoch millis from nowlonggetNextEpochMillis(@NotNull Instant initInstant) Get the next epoch millis from nowlonggetNextEpochMillis(@NotNull ZonedDateTime initTime) Get the next epoch millis from the initial time@NotNull InstantGet the next instant from now@NotNull InstantgetNextInstant(@NotNull Instant initInstant) Get the next instant from the initial instant@NotNull ZonedDateTimeGet the next time from now@NotNull ZonedDateTimegetNextTime(@NotNull ZonedDateTime initTime) Get the next time from the initial timelongGet the remaining millis from now to the next timelonggetRemainingMillis(@NotNull Instant initInstant) Get the remaining millis from now to the next timelonggetRemainingMillis(@NotNull ZonedDateTime initTime) Get the remaining millis from now to the next time
-
Constructor Details
-
CronTimeManager
Create a new manager- Parameters:
cronList- the cron list
-
CronTimeManager
public CronTimeManager(@NotNull @NotNull com.cronutils.model.Cron... crons) Create a new manager- Parameters:
crons- the cron list
-
-
Method Details
-
getNextTime
Get the next time from the initial time- Parameters:
initTime- the initial time to get the next time- Returns:
- the next time
-
getNextTime
Get the next time from now- Returns:
- the next time
-
getNextInstant
Get the next instant from the initial instant- Parameters:
initInstant- the initial instant to get the next instant- Returns:
- the next instant
-
getNextInstant
Get the next instant from now- Returns:
- the next instant
-
getNextEpochMillis
Get the next epoch millis from the initial time- Parameters:
initTime- the initial time to get the next time- Returns:
- the epoch millis
-
getNextEpochMillis
public long getNextEpochMillis()Get the next epoch millis from now- Returns:
- the epoch millis
-
getNextEpochMillis
Get the next epoch millis from now- Parameters:
initInstant- the initial instant to get the next time- Returns:
- the epoch millis
-
getRemainingMillis
Get the remaining millis from now to the next time- Parameters:
initTime- the initial time to get the next time- Returns:
- the millis
-
getRemainingMillis
public long getRemainingMillis()Get the remaining millis from now to the next time- Returns:
- the millis
-
getRemainingMillis
Get the remaining millis from now to the next time- Parameters:
initInstant- the initial instant to get the next time- Returns:
- the millis
-
getCronList
Get the cron list- Returns:
- the cron list
-