Class CooldownKey

java.lang.Object
valorless.rarespawns.datamodels.CooldownKey

public class CooldownKey extends Object
Immutable key combining a player UUID and a Soul Power ID for cooldown maps.

Instances are used as stable keys in in-memory cooldown registries. The toString() format is ":" and is suitable for use as a Map key.

  • Field Details

    • player

      public final UUID player
      The unique identifier of the player.
    • power

      public final String power
      The ID of the Soul Power this key refers to.
  • Constructor Details

    • CooldownKey

      public CooldownKey(UUID uuid, String id)
      Creates a key from a UUID and power ID.
      Parameters:
      uuid - the player's UUID
      id - the power ID
    • CooldownKey

      public CooldownKey(String uuid, String id)
      Creates a key from a UUID String and power ID.
      Parameters:
      uuid - the player's UUID in string form
      id - the power ID
      Throws:
      IllegalArgumentException - if the UUID string is invalid
    • CooldownKey

      public CooldownKey(org.bukkit.entity.Player player, String id)
      Creates a key from a Player and power ID.
      Parameters:
      player - the player instance
      id - the power ID
  • Method Details

    • toString

      public String toString()
      Returns a stable string key in the form ":".
      Overrides:
      toString in class Object