Record Class CooldownResult.Cooling

java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.server.cooldown.CooldownResult.Cooling
All Implemented Interfaces:
CooldownResult
Enclosing interface:
CooldownResult

public static record CooldownResult.Cooling(long remaining, TimeUnit unit, CooldownScope scope, net.kyori.adventure.key.Key id, Cooldown cooldown, Scheduler scheduler) extends Record implements CooldownResult
  • Constructor Details

    • Cooling

      public Cooling(long remaining, TimeUnit unit, CooldownScope scope, net.kyori.adventure.key.Key id, Cooldown cooldown, Scheduler scheduler)
      Creates an instance of a Cooling record class.
      Parameters:
      remaining - the value for the remaining record component
      unit - the value for the unit record component
      scope - the value for the scope record component
      id - the value for the id record component
      cooldown - the value for the cooldown record component
      scheduler - the value for the scheduler record component
  • Method Details

    • isReady

      public boolean isReady()
      Specified by:
      isReady in interface CooldownResult
    • ifReady

      public CooldownResult ifReady(Runnable action)
      Specified by:
      ifReady in interface CooldownResult
    • ifCoolingLeft

      public CooldownResult ifCoolingLeft(BiConsumer<Long,TimeUnit> action)
      Specified by:
      ifCoolingLeft in interface CooldownResult
    • onExpire

      public CooldownResult onExpire(Runnable action)
      Specified by:
      onExpire in interface CooldownResult
    • onTick

      public CooldownResult onTick(long interval, TimeUnit tickUnit, BiConsumer<Long,TimeUnit> action)
      Specified by:
      onTick in interface CooldownResult
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • remaining

      public long remaining()
      Returns the value of the remaining record component.
      Returns:
      the value of the remaining record component
    • unit

      public TimeUnit unit()
      Returns the value of the unit record component.
      Returns:
      the value of the unit record component
    • scope

      public CooldownScope scope()
      Returns the value of the scope record component.
      Returns:
      the value of the scope record component
    • id

      public net.kyori.adventure.key.Key id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • cooldown

      public Cooldown cooldown()
      Returns the value of the cooldown record component.
      Returns:
      the value of the cooldown record component
    • scheduler

      public Scheduler scheduler()
      Returns the value of the scheduler record component.
      Returns:
      the value of the scheduler record component