java.lang.Object
com.inductiveautomation.ignition.common.xmlserialization.serialization.equalitydelegates.EqualityDelegateSupport

public class EqualityDelegateSupport extends Object
When the default equals() and hashCode() of a class needs to be overridden for any purpose. An EqualityDelegate can supply an alternate definition for these two methods. The following methods: safeEquals(Object, Object), safeHashCode(Object) should be used in place of the standard methods for equality checks and hash code generation. A specific use of this class provides alternative definitions for serialization purposes (check out: ReferenceTracker)
  • Constructor Details

    • EqualityDelegateSupport

      public EqualityDelegateSupport()
  • Method Details

    • get

      protected EqualityDelegate get(Class<?> key)
    • containsKey

      protected boolean containsKey(Class<?> key)
    • registerEqualityDelegate

      public void registerEqualityDelegate(Class<?> key, EqualityDelegate<?> delegate)
    • safeHashCode

      public int safeHashCode(Object foo)
    • safeEquals

      public boolean safeEquals(Object foo, Object bar)
      equals that uses null-safe equality (null==null: true) and the delegates to the equalityDelegates if there is one registered for the argument class.