Top Description Fields Constructors Methods
org.apache.commons.collections4.keyvalue

public abstract Class AbstractKeyValue<K, V>

extends Object
implements KeyValue<K, V>
Class Inheritance
All Implemented Interfaces
org.apache.commons.collections4.KeyValue
Known Direct Subclasses
org.apache.commons.collections4.keyvalue.AbstractMapEntry, org.apache.commons.collections4.keyvalue.DefaultKeyValue
Type Parameters
<K>
the type of keys
<V>
the type of values
Imports
org.apache.commons.collections4.KeyValue

Abstract pair class to assist with creating KeyValue and Map.Entry implementations.
Since
3.0

Field Summary

Modifier and TypeField and Description
private K
key

The key

private V
value

The value

Constructor Summary

AccessConstructor and Description
protected
AbstractKeyValue(final K
the key for the entry, may be null
key
,
final V
the value for the entry, may be null
value
)

Constructs a new pair with the specified key and given value.

Method Summary

Modifier and TypeMethod and Description
public K

Returns:

the key
getKey
()

Implements org.apache.commons.collections4.KeyValue.getKey.

Gets the key from the pair.
public V

Returns:

the value
getValue
()

Implements org.apache.commons.collections4.KeyValue.getValue.

Gets the value from the pair.
protected K
setKey(final K key)

protected V
setValue(final V value)

public String

Returns:

a String view of the entry
toString
()

Overrides java.lang.Object.toString.

Gets a debugging String view of the pair.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

keyback to summary
private K key

The key

valueback to summary
private V value

The value

Constructor Detail

AbstractKeyValueback to summary
protected AbstractKeyValue(final K key, final V value)

Constructs a new pair with the specified key and given value.

Parameters
key:K

the key for the entry, may be null

value:V

the value for the entry, may be null

Method Detail

getKeyback to summary
public K getKey()

Implements org.apache.commons.collections4.KeyValue.getKey.

Gets the key from the pair.

Returns:K

the key

Annotations
@Override
getValueback to summary
public V getValue()

Implements org.apache.commons.collections4.KeyValue.getValue.

Gets the value from the pair.

Returns:V

the value

Annotations
@Override
setKeyback to summary
protected K setKey(final K key)
setValueback to summary
protected V setValue(final V value)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Gets a debugging String view of the pair.

Returns:String

a String view of the entry

Annotations
@Override