Class NamedLockKey


  • public final class NamedLockKey
    extends java.lang.Object
    A named lock key.

    Instances of this class are immutable, implement hash/equals and toString method (for easier debug).

    Since:
    2.0.0
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      java.lang.String name()
      Returns this key name, never null.
      static NamedLockKey of​(java.lang.String name, java.lang.String... resources)  
      static NamedLockKey of​(java.lang.String name, java.util.Collection<java.lang.String> resources)  
      java.util.Collection<java.lang.String> resources()
      Auxiliary information, not used by Resolver.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • name

        public java.lang.String name()
        Returns this key name, never null. This is the identity of this lock key instance and is the only thing that is used in implementations of hash/equals, etc.
      • resources

        public java.util.Collection<java.lang.String> resources()
        Auxiliary information, not used by Resolver. Meant to return resource name(s) or any kind of identifiers protected by this key, never null.

        Contents on this field is consumer project specific, and should be used only as "extra information": resolver itself uses these only for logging purposes.

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • of

        public static NamedLockKey of​(java.lang.String name,
                                      java.lang.String... resources)
      • of

        public static NamedLockKey of​(java.lang.String name,
                                      java.util.Collection<java.lang.String> resources)