public static interface DataSerializer.Identifiable extends DataSerializer
If omitted from the DataSerializer plug-in or if the hasBinaryEquality()
answers true, then the serialized form of the data is used to
calculate a hash code and test for equality.
DataSerializer.DataAttributeInflatable, DataSerializer.Identifiable, DataSerializer.SpecialValue, DataSerializer.UserReadable| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(DataObjectContext ctx,
XsDataInputStream dataObjectInput1,
XsDataInputStream dataObjectInput2)
Answers true if the two serialized data objects are equivalent.
|
boolean |
hasBinaryEquality()
Answers
true when the serialized form of the
data object can be used directly to calculate equality and the hashCode. |
int |
hashCode(DataObjectContext ctx,
XsDataInputStream dataObjectInput)
For the serialized data object, retrieve the hash code for that object.
|
inflateDataObject, serializeDataObjectboolean hasBinaryEquality()
true when the serialized form of the
data object can be used directly to calculate equality and the hashCode.
When true, the caller can skip calling the hashCode and equals method on this DataSerializer
and use the entire serialized form as the identity.
If the serialized form of the identity includes unstructured data or meta-information
that isn't part of the identity, this method must answer false.
A DataSerializer must return consistent answers for hasBinaryEquality()
for the same type of object.
When this method returns true, the caller calculates the hashCode based
on its own algorithm. When this method returns false,
the hashCode(DataObjectContext, XsDataInputStream) method is used to calculate the hashCode using
a different algorithm, thereby breaking the contract for Object.hashCode().
int hashCode(DataObjectContext ctx, XsDataInputStream dataObjectInput) throws IOException
Any two objects which answer true when passed to .equals
must answer the same value for this method.
Do not store or use the data stream beyond the confines of this method call. The data stream is owned by the WebSphere eXtreme Scale framework and my be closed, pooled or reused as required.
ctx - the Context of the method call.dataObjectInput - the data input stream to read the object, produced from
DataSerializer.serializeDataObject(DataObjectContext, Object, XsDataOutputStream).
Must not be null.IOException - thrown if there is a problem reading the data.boolean equals(DataObjectContext ctx, XsDataInputStream dataObjectInput1, XsDataInputStream dataObjectInput2) throws IOException
Do not store or use the data streams beyond the confines of this method call. The data streams are owned by the WebSphere eXtreme Scale framework and my be closed, pooled or reused as required.
ctx - the context of the method call.dataObjectInput1 - the data input stream to read the object, produced from
DataSerializer.serializeDataObject(DataObjectContext, Object, XsDataOutputStream).
Must not be null.dataObjectInput2 - the data input stream to read the object, produced from
DataSerializer.serializeDataObject(DataObjectContext, Object, XsDataOutputStream).
Must not be null.IOException - thrown if there is a problem reading the data.