net.floodlightcontroller.devicemanager.internal
Class IndexedEntity
java.lang.Object
net.floodlightcontroller.devicemanager.internal.IndexedEntity
public class IndexedEntity
- extends java.lang.Object
This is a thin wrapper around 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
- Author:
- readams
|
Method Summary |
boolean |
equals(java.lang.Object obj)
|
int |
hashCode()
|
boolean |
hasNonNullKeys()
Check whether this entity has non-null values in any of its key fields |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
keyFields
protected java.util.EnumSet<IDeviceService.DeviceField> keyFields
entity
protected Entity entity
logger
protected static org.slf4j.Logger logger
IndexedEntity
public IndexedEntity(java.util.EnumSet<IDeviceService.DeviceField> keyFields,
Entity entity)
- Create a new
IndexedEntity for the given Entity using
the provided key fields.
- Parameters:
keyFields - The key fields that will be used for computing
hashCode() and equals(Object)entity - the entity to wrap
hasNonNullKeys
public boolean hasNonNullKeys()
- Check whether this entity has non-null values in any of its key fields
- Returns:
- true if any key fields have a non-null value
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals in class java.lang.Object