Record Class ReactorBukkitScheduler

java.lang.Object
java.lang.Record
io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
All Implemented Interfaces:
reactor.core.Disposable, reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Worker

public record ReactorBukkitScheduler(org.bukkit.plugin.java.JavaPlugin plugin, org.bukkit.scheduler.BukkitScheduler scheduler) extends Record implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Worker
  • Nested Class Summary

    Nested classes/interfaces inherited from interface reactor.core.Disposable

    reactor.core.Disposable.Composite, reactor.core.Disposable.Swap

    Nested classes/interfaces inherited from interface reactor.core.scheduler.Scheduler

    reactor.core.scheduler.Scheduler.Worker
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final org.bukkit.plugin.java.JavaPlugin
    The field for the plugin record component.
    private final org.bukkit.scheduler.BukkitScheduler
    The field for the scheduler record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReactorBukkitScheduler(org.bukkit.plugin.java.JavaPlugin plugin, org.bukkit.scheduler.BukkitScheduler scheduler)
    Creates an instance of a ReactorBukkitScheduler record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull reactor.core.scheduler.Scheduler.Worker
    A new Scheduler.Worker.
    void
    This method does nothing and is unused.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    org.bukkit.plugin.java.JavaPlugin
    Returns the value of the plugin record component.
    @NotNull reactor.core.Disposable
    schedule(@NotNull Runnable task)
    Delegates to the BukkitScheduler.
    @NotNull reactor.core.Disposable
    schedule(@NotNull Runnable task, long delay, @Nullable TimeUnit unit)
    Delegates to the BukkitScheduler with a delay.
    @NotNull reactor.core.Disposable
    schedulePeriodically(@NotNull Runnable task, long initialDelay, long period, @Nullable TimeUnit unit)
    Delegates to the BukkitScheduler with a delay and a period.
    org.bukkit.scheduler.BukkitScheduler
    Returns the value of the scheduler record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface reactor.core.Disposable

    isDisposed

    Methods inherited from interface reactor.core.scheduler.Scheduler

    now, start
  • Field Details

    • plugin

      private final org.bukkit.plugin.java.JavaPlugin plugin
      The field for the plugin record component.
    • scheduler

      private final org.bukkit.scheduler.BukkitScheduler scheduler
      The field for the scheduler record component.
  • Constructor Details

    • ReactorBukkitScheduler

      public ReactorBukkitScheduler(org.bukkit.plugin.java.JavaPlugin plugin, org.bukkit.scheduler.BukkitScheduler scheduler)
      Creates an instance of a ReactorBukkitScheduler record class.
      Parameters:
      plugin - the value for the plugin record component
      scheduler - the value for the scheduler record component
  • Method Details

    • schedule

      @NotNull public @NotNull reactor.core.Disposable schedule(@NotNull @NotNull Runnable task)
      Delegates to the BukkitScheduler.
      Specified by:
      schedule in interface reactor.core.scheduler.Scheduler
      Specified by:
      schedule in interface reactor.core.scheduler.Scheduler.Worker
      Parameters:
      task - The task to delegate.
      Returns:
      A disposable that can be used to cancel the task.
    • schedule

      @NotNull public @NotNull reactor.core.Disposable schedule(@NotNull @NotNull Runnable task, long delay, @Nullable @Nullable TimeUnit unit)
      Delegates to the BukkitScheduler with a delay.
      Specified by:
      schedule in interface reactor.core.scheduler.Scheduler
      Specified by:
      schedule in interface reactor.core.scheduler.Scheduler.Worker
      Parameters:
      task - The task to delegate
      delay - The amount of time to wait before running the task
      unit - Unused parameter in this implementation. Regardless of what value you use, this parameter will never be called.
      Returns:
      A disposable that can be used to cancel the task.
    • schedulePeriodically

      @NotNull public @NotNull reactor.core.Disposable schedulePeriodically(@NotNull @NotNull Runnable task, long initialDelay, long period, @Nullable @Nullable TimeUnit unit)
      Delegates to the BukkitScheduler with a delay and a period. The initial delay may be 0L, but the period must be greater than 0L.
      Specified by:
      schedulePeriodically in interface reactor.core.scheduler.Scheduler
      Specified by:
      schedulePeriodically in interface reactor.core.scheduler.Scheduler.Worker
      Parameters:
      task - The task to delegate.
      initialDelay - The amount of time to wait before running the task.
      period - The amount of time to wait between each execution of the task.
      unit - Unused parameter in this implementation. Regardless of what value you use, this parameter will never be called.
      Returns:
      A disposable that can be used to cancel the task.
    • createWorker

      @NotNull public @NotNull reactor.core.scheduler.Scheduler.Worker createWorker()
      A new Scheduler.Worker.
      Specified by:
      createWorker in interface reactor.core.scheduler.Scheduler
      Returns:
      This class instance, as it implements Scheduler.Worker.
    • dispose

      public void dispose()
      This method does nothing and is unused.
      Specified by:
      dispose in interface reactor.core.Disposable
      Specified by:
      dispose in interface reactor.core.scheduler.Scheduler
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • plugin

      public org.bukkit.plugin.java.JavaPlugin plugin()
      Returns the value of the plugin record component.
      Returns:
      the value of the plugin record component
    • scheduler

      public org.bukkit.scheduler.BukkitScheduler scheduler()
      Returns the value of the scheduler record component.
      Returns:
      the value of the scheduler record component