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
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCronTimeManager
(@NotNull com.cronutils.model.Cron... crons) Create a new managerCronTimeManager
(@NotNull com.cronutils.model.CronType cronType, @NotNull String... cronStrings) Create a new managerCronTimeManager
(@NotNull com.cronutils.model.CronType cronType, @NotNull List<String> cronStrings) Create a new managerCronTimeManager
(@NotNull com.cronutils.model.definition.CronDefinition definition, @NotNull String... cronStrings) Create a new managerCronTimeManager
(@NotNull com.cronutils.model.definition.CronDefinition definition, @NotNull List<String> cronStrings) 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 listlong
Get the next epoch millis from nowlong
getNextEpochMillis
(@NotNull Instant initInstant) Get the next epoch millis from nowlong
getNextEpochMillis
(@NotNull ZonedDateTime initTime) Get the next epoch millis from the initial time@NotNull Instant
Get the next instant from now@NotNull Instant
getNextInstant
(@NotNull Instant initInstant) Get the next instant from the initial instant@NotNull ZonedDateTime
Get the next time from now@NotNull ZonedDateTime
getNextTime
(@NotNull ZonedDateTime initTime) Get the next time from the initial timelong
Get the remaining millis from now to the next timelong
getRemainingMillis
(@NotNull Instant initInstant) Get the remaining millis from now to the next timelong
getRemainingMillis
(@NotNull ZonedDateTime initTime) Get the remaining millis from now to the next time
-
Field Details
-
LOGGER
The internal logger
-
-
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
-
CronTimeManager
public CronTimeManager(@NotNull @NotNull com.cronutils.model.definition.CronDefinition definition, @NotNull @NotNull List<String> cronStrings) Create a new manager- Parameters:
definition
- the cron definitioncronStrings
- the cron string list
-
CronTimeManager
public CronTimeManager(@NotNull @NotNull com.cronutils.model.definition.CronDefinition definition, @NotNull @NotNull String... cronStrings) Create a new manager- Parameters:
definition
- the cron definitioncronStrings
- the cron string list
-
CronTimeManager
public CronTimeManager(@NotNull @NotNull com.cronutils.model.CronType cronType, @NotNull @NotNull List<String> cronStrings) Create a new manager- Parameters:
cronType
- the cron typecronStrings
- the cron string list
-
CronTimeManager
public CronTimeManager(@NotNull @NotNull com.cronutils.model.CronType cronType, @NotNull @NotNull String... cronStrings) Create a new manager- Parameters:
cronType
- the cron typecronStrings
- the cron string 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
-