Class IdentityUtils.Wrapper<E>

  • Type Parameters:
    E - wrapped element's type
    Enclosing class:
    IdentityUtils

    public static class IdentityUtils.Wrapper<E>
    extends java.lang.Object
    An object that wraps any other in the way, that equals(Object) and hashCode() depends only on wrapped object's instance.

    In other words two wrappers are considered as equal only if they wrap the same instance.

    • Constructor Summary

      Constructors 
      Constructor Description
      Wrapper​(E element)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      E getElement()  
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Wrapper

        public Wrapper​(E element)
    • Method Detail

      • getElement

        public E getElement()
      • equals

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

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