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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCronTimeManager(@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 listlongGet the next epoch millis from nowlonggetNextEpochMillis(@NotNull ZonedDateTime initTime) Get the next epoch millis from the initial time@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 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 now- Returns:
- the next time
-
getNextTime
Get the next time from the initial time- Parameters:
initTime- the initial time to get the next time- Returns:
- the next time
-
getNextEpochMillis
public long getNextEpochMillis()Get the next epoch millis from now- Returns:
- the epoch millis
-
getNextEpochMillis
Get the next epoch millis from the initial time- Parameters:
initTime- the initial time to get the next time- Returns:
- the epoch 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:
initTime- the initial time to get the next time- Returns:
- the millis
-
getCronList
Get the cron list- Returns:
- the cron list
-