Package dev.hypera.chameleon.scheduler
Interface Schedule
-
@NonExtendable public interface ScheduleSchedule.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static @NotNull Scheduleduration(@NotNull Duration duration)Create a new schedule that is executed according to the provided Duration.static @NotNull Schedulehours(long hours)Create a new schedule that runs everyhourshours.static @NotNull Schedulemillis(long millis)Create a new schedule that runs everymillismilliseconds.static @NotNull Scheduleminutes(long minutes)Create a new schedule that runs everyminutesminutes.static @NotNull Schedulenone()Create a new schedule that is never executed.static @NotNull Scheduleseconds(long seconds)Create a new schedule that runs everysecondsseconds.static @NotNull Scheduleticks(long ticks)Create a new schedule that is executed everyticksticks.@NotNull DurationtoDuration()Convert this schedule to a Duration.longtoMillis()Convert this schedule to milliseconds.longtoTicks()Convert this schedule to ticks.
-
-
-
Method Detail
-
none
@NotNull static @NotNull Schedule none()
Create a new schedule that is never executed.- Returns:
- new schedule.
-
duration
@NotNull static @NotNull Schedule duration(@NotNull @NotNull Duration duration)
Create a new schedule that is executed according to the provided Duration.- Parameters:
duration- Duration.- Returns:
- new schedule.
-
ticks
@NotNull static @NotNull Schedule ticks(long ticks)
Create a new schedule that is executed everyticksticks.- Parameters:
ticks- Ticks between executions.- Returns:
- new schedule.
-
hours
@NotNull static @NotNull Schedule hours(long hours)
Create a new schedule that runs everyhourshours.- Parameters:
hours- Hours between runs.- Returns:
- new schedule.
-
minutes
@NotNull static @NotNull Schedule minutes(long minutes)
Create a new schedule that runs everyminutesminutes.- Parameters:
minutes- Minutes between runs.- Returns:
- new schedule.
-
seconds
@NotNull static @NotNull Schedule seconds(long seconds)
Create a new schedule that runs everysecondsseconds.- Parameters:
seconds- Seconds between runs.- Returns:
- new schedule.
-
millis
@NotNull static @NotNull Schedule millis(long millis)
Create a new schedule that runs everymillismilliseconds.- Parameters:
millis- Milliseconds between runs.- Returns:
- new schedule.
-
toTicks
long toTicks()
Convert this schedule to ticks.- Returns:
- ticks.
-
toMillis
long toMillis()
Convert this schedule to milliseconds.- Returns:
- milliseconds.
-
toDuration
@NotNull @NotNull Duration toDuration()
Convert this schedule to a Duration.- Returns:
- Duration.
-
-