public interface HollowObjectHashCodeFinder
With this interface, in conjunction with a cooperating data ingestion mechanism, it is possible to use custom hash codes in Hollow sets and maps.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFINED_HASH_CODES_HEADER_NAME |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getTypesWithDefinedHashCodes()
Returns the set of types which have hash codes defined (i.e.
|
int |
hashCode(int ordinal,
java.lang.Object objectToHash)
Deprecated.
|
int |
hashCode(java.lang.Object objectToHash)
For look-up at runtime.
|
int |
hashCode(java.lang.String typeName,
int ordinal,
java.lang.Object objectToHash)
For serialization.
|
static final java.lang.String DEFINED_HASH_CODES_HEADER_NAME
int hashCode(java.lang.Object objectToHash)
If using simple ordinal-based hashing, then objectToHash must be a HollowRecord
, and the return value will be
objectToHash.getOrdinal();
Otherwise, the hash code is determined with exactly the same logic as was used during serialization.
int hashCode(java.lang.String typeName, int ordinal, java.lang.Object objectToHash)
At serialization time, we know the ordinal of a newly added object, but may not know how to hash the object which is being serialized, which is necessary for Sets and Maps.
If using simple ordinal-based hashing, the ordinal will be returned. Otherwise, the return value will be calculated based on the objectToHash.
java.util.Set<java.lang.String> getTypesWithDefinedHashCodes()
@Deprecated int hashCode(int ordinal, java.lang.Object objectToHash)