Package sc.util

Class IdentityWrapper<T>


  • public class IdentityWrapper<T>
    extends java.lang.Object
    Utility class to wrap an object for insertion into a HashMap or whatever to hide its equals/hashCode and instead do comparisons on the wrappers system identity.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      T wrapped  
    • Constructor Summary

      Constructors 
      Constructor Description
      IdentityWrapper​(T wrapped)  
    • Method Summary

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

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • wrapped

        public T wrapped
    • Constructor Detail

      • IdentityWrapper

        public IdentityWrapper​(T wrapped)
    • Method Detail

      • hashCode

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

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object