Class PerThreadCache.Key<T>

java.lang.Object
com.google.gerrit.server.cache.PerThreadCache.Key<T>
Enclosing class:
PerThreadCache

public static final class PerThreadCache.Key<T> extends Object
Unique key for key-value mappings stored in PerThreadCache. The key is based on the value's class and a list of identifiers that in combination uniquely set the object apart form others of the same class.
  • Method Details

    • create

      public static <T> PerThreadCache.Key<T> create(Class<T> clazz, Object identifier)
      Returns a key based on the value's class and an identifier that uniquely identify the value. The identifier needs to implement equals() and hashCode().
    • create

      public static <T> PerThreadCache.Key<T> create(Class<T> clazz, Object... identifiers)
      Returns a key based on the value's class and a set of identifiers that uniquely identify the value. Identifiers need to implement equals() and hashCode().
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object