public class IndexedEntity
extends java.lang.Object
Entity
that allows overriding
the behavior of Object.hashCode()
and Object.equals(Object)
so that the keying behavior in a hash map can be changed dynamically.Modifier and Type | Field and Description |
---|---|
protected Entity |
entity |
private int |
hashCode |
protected java.util.EnumSet<IDeviceService.DeviceField> |
keyFields |
Constructor and Description |
---|
IndexedEntity(java.util.EnumSet<IDeviceService.DeviceField> keyFields,
Entity entity)
Creates a new
IndexedEntity for the given Entity using
the provided key fields. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
hasNonNullKeys()
Checks whether this entity has non-null values in any of its key fields.
|
protected java.util.EnumSet<IDeviceService.DeviceField> keyFields
protected Entity entity
private int hashCode
public IndexedEntity(java.util.EnumSet<IDeviceService.DeviceField> keyFields, Entity entity)
IndexedEntity
for the given Entity
using
the provided key fields.keyFields
- The key fields that will be used for computing
hashCode()
and equals(Object)
entity
- the entity to wrappublic boolean hasNonNullKeys()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object