Class ObjectIdentityKey

java.lang.Object
org.onehippo.cms7.util.ObjectIdentityKey

public class ObjectIdentityKey extends Object
ObjectIdentityKey is an object wrapper to be used as an object identity based key in a Collection Map or Set.

Java itself only provides the IdentityHashMap class. When for example a ConcurrentHashMap needs to be used,instead and the key object equals implementation isn't using object identity comparison, then this class can be used to wrap the key objects to enforce this.

  • Constructor Details

    • ObjectIdentityKey

      public ObjectIdentityKey(Object object)
  • Method Details

    • hashCode

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

      public Object getObject()
    • equals

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