Class CooldownManager

    • Field Summary

      Fields 
      Modifier and Type Field Description
      @NotNull java.util.Set<AnnoyingCooldown> cooldowns
      A set of all cooldowns
    • Constructor Summary

      Constructors 
      Constructor Description
      CooldownManager()
      Constructs a new cooldown manager
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull java.util.Optional<AnnoyingCooldown> getCooldown​(@NotNull java.lang.Object key, @NotNull java.lang.Object type)
      Get a cooldown with the given key and type
      @NotNull AnnoyingCooldown getCooldownElseNew​(@NotNull java.lang.Object key, @NotNull java.lang.Object type)
      Get a cooldown with the given key and type
      If the cooldown doesn't exist yet, it will create a new one with the given key and type (it won't start it though)
      @NotNull java.util.Set<AnnoyingCooldown> getCooldownsByKey​(@NotNull java.lang.Object key)
      Get all cooldowns with the given key
      @NotNull java.util.Set<AnnoyingCooldown> getCooldownsByType​(@NotNull java.lang.Object type)
      Get all cooldowns with the given type
      • Methods inherited from class xyz.srnyx.javautilities.parents.Stringable

        toString, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • cooldowns

        @NotNull
        public final @NotNull java.util.Set<AnnoyingCooldown> cooldowns
        A set of all cooldowns
    • Constructor Detail

      • CooldownManager

        public CooldownManager()
        Constructs a new cooldown manager
    • Method Detail

      • getCooldownsByType

        @NotNull
        public @NotNull java.util.Set<AnnoyingCooldown> getCooldownsByType​(@NotNull
                                                                           @NotNull java.lang.Object type)
        Get all cooldowns with the given type
        Parameters:
        type - the type of the cooldowns
        Returns:
        all cooldowns with the given type
      • getCooldownsByKey

        @NotNull
        public @NotNull java.util.Set<AnnoyingCooldown> getCooldownsByKey​(@NotNull
                                                                          @NotNull java.lang.Object key)
        Get all cooldowns with the given key
        Parameters:
        key - the key of the cooldowns
        Returns:
        all cooldowns with the given key
      • getCooldown

        @NotNull
        public @NotNull java.util.Optional<AnnoyingCooldown> getCooldown​(@NotNull
                                                                         @NotNull java.lang.Object key,
                                                                         @NotNull
                                                                         @NotNull java.lang.Object type)
        Get a cooldown with the given key and type
        Parameters:
        key - the key of the cooldown
        type - the type of the cooldown
        Returns:
        the cooldown with the given key and type
      • getCooldownElseNew

        @NotNull
        public @NotNull AnnoyingCooldown getCooldownElseNew​(@NotNull
                                                            @NotNull java.lang.Object key,
                                                            @NotNull
                                                            @NotNull java.lang.Object type)
        Get a cooldown with the given key and type
        If the cooldown doesn't exist yet, it will create a new one with the given key and type (it won't start it though)
        Parameters:
        key - the key of the cooldown
        type - the type of the cooldown
        Returns:
        the cooldown with the given key and type or the newly created cooldown