Class EqualityDelegateSupport
- java.lang.Object
-
- com.inductiveautomation.ignition.common.xmlserialization.serialization.equalitydelegates.EqualityDelegateSupport
-
public class EqualityDelegateSupport extends java.lang.ObjectWhen 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 Summary
Constructors Constructor Description EqualityDelegateSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancontainsKey(java.lang.Class<?> key)protected EqualityDelegateget(java.lang.Class<?> key)voidregisterEqualityDelegate(java.lang.Class<?> key, EqualityDelegate<?> delegate)booleansafeEquals(java.lang.Object foo, java.lang.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.intsafeHashCode(java.lang.Object foo)
-
-
-
Method Detail
-
get
protected EqualityDelegate get(java.lang.Class<?> key)
-
containsKey
protected boolean containsKey(java.lang.Class<?> key)
-
registerEqualityDelegate
public void registerEqualityDelegate(java.lang.Class<?> key, EqualityDelegate<?> delegate)
-
safeHashCode
public int safeHashCode(java.lang.Object foo)
-
safeEquals
public boolean safeEquals(java.lang.Object foo, java.lang.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.
-
-