Interface Schedule


  • @NonExtendable
    public interface Schedule
    Schedule.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      static @NotNull Schedule duration​(@NotNull Duration duration)
      Create a new schedule that is executed according to the provided Duration.
      static @NotNull Schedule hours​(long hours)
      Create a new schedule that runs every hours hours.
      static @NotNull Schedule millis​(long millis)
      Create a new schedule that runs every millis milliseconds.
      static @NotNull Schedule minutes​(long minutes)
      Create a new schedule that runs every minutes minutes.
      static @NotNull Schedule none()
      Create a new schedule that is never executed.
      static @NotNull Schedule seconds​(long seconds)
      Create a new schedule that runs every seconds seconds.
      static @NotNull Schedule ticks​(long ticks)
      Create a new schedule that is executed every ticks ticks.
      @NotNull Duration toDuration()
      Convert this schedule to a Duration.
      long toMillis()
      Convert this schedule to milliseconds.
      long toTicks()
      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 every ticks ticks.
        Parameters:
        ticks - Ticks between executions.
        Returns:
        new schedule.
      • hours

        @NotNull
        static @NotNull Schedule hours​(long hours)
        Create a new schedule that runs every hours hours.
        Parameters:
        hours - Hours between runs.
        Returns:
        new schedule.
      • minutes

        @NotNull
        static @NotNull Schedule minutes​(long minutes)
        Create a new schedule that runs every minutes minutes.
        Parameters:
        minutes - Minutes between runs.
        Returns:
        new schedule.
      • seconds

        @NotNull
        static @NotNull Schedule seconds​(long seconds)
        Create a new schedule that runs every seconds seconds.
        Parameters:
        seconds - Seconds between runs.
        Returns:
        new schedule.
      • millis

        @NotNull
        static @NotNull Schedule millis​(long millis)
        Create a new schedule that runs every millis milliseconds.
        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.