Class IDKey


  • final class IDKey
    extends Object
    Wrap an identity key (System.identityHashCode()) so that an object can only be equal() to itself. This is necessary to disambiguate the occasional duplicate identityHashCodes that can occur.
    • Constructor Detail

      • IDKey

        IDKey​(Object _value)
        Constructor for IDKey
        Parameters:
        _value - The value
    • Method Detail

      • hashCode

        public int hashCode()
        returns hash code - i.e. the system identity hashcode.
        Overrides:
        hashCode in class Object
        Returns:
        the hashcode
      • equals

        public boolean equals​(Object other)
        checks if instances are equal
        Overrides:
        equals in class Object
        Parameters:
        other - The other object to compare to
        Returns:
        if the instances are for the same object