Class KeyedLockMap<K>

java.lang.Object
com.cryptomorin.xseries.profiles.lock.KeyedLockMap<K>
Type Parameters:
K - the type of object used to identify what the locks are associated to.

@Internal public final class KeyedLockMap<K> extends Object
A registry that queues locks per-object using KeyedLock.
  • Constructor Details

    • KeyedLockMap

      public KeyedLockMap()
  • Method Details

    • lock

      public KeyedLock<K> lock(K key)
      Doesn't actually lock the object, KeyedLock.lock() should be used immediatelly as the first statement after this method. The main reason why this isn't done in this method is because try-with-resources for a reference without delcaring a variable is not supported in Java 8, so we'd have to suppress the unused variable warning every time we use this method.
    • unlock

      public void unlock(KeyedLock<K> lock)
    • toString

      public String toString()
      Overrides:
      toString in class Object