Class IdentityRef<T>


  • public final class IdentityRef<T>
    extends java.lang.Object
    A reference to another object that uses the identity semantics of that object for equality.

    The intended purpose of these references is to make give identity semantics to Map keys. For example, LinkedHashMap<IdentityRef<Foo>, Bar>, behaves as an IdentityHashMap but with deterministic iteration order.

    • Method Detail

      • of

        public static <U> IdentityRef<U> of​(U value)
      • get

        public T get()
      • 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