java.lang.Object | +--org.apache.commons.collections.keyvalue.AbstractKeyValue | +--org.apache.commons.collections.keyvalue.DefaultKeyValue
Constructs a new pair with a null key and null value. |
DefaultKeyValue(final Object key, final Object value) Constructs a new pair with the specified key and given value. |
DefaultKeyValue(final KeyValue pair) Constructs a new pair from the specified KeyValue. |
DefaultKeyValue(final Map.Entry entry) Constructs a new pair from the specified MapEntry. |
boolean | equals(final Object obj) Compares this Map Entry with another Map Entry. |
int | hashCode() Gets a hashCode compatible with the equals method. |
Object | setKey(final Object key) Sets the key. |
Object | setValue(final Object value) Sets the value. |
Map.Entry | Returns a new Map.Entry object with key and value from this pair. |
public DefaultKeyValue()
public DefaultKeyValue(final KeyValue pair)
- if the entry is nullpublic DefaultKeyValue(final Map.Entry entry)
- if the entry is nullpublic DefaultKeyValue(final Object key, final Object value)
public boolean equals(final Object obj)
DefaultKeyValue,
and its key and value are equal to this object's key and value.
public int hashCode()
public Object setKey(final Object key)
- if key is this objectpublic Object setValue(final Object value)
- if value is this objectpublic Entry toMapEntry()
Map.Entry object with key and value from this pair.
DefaultKeyValueinstance may not contain itself as a key or value.