Package org.pushingpixels.flamingo.api.common

# Class KeyValuePair<S,T>

java.lang.Object
org.pushingpixels.flamingo.api.common.KeyValuePair<S,T>

Type Parameters:
  `S` - Key class.
  `T` - Value class.

Direct Known Subclasses:
  `StringValuePair`

public class KeyValuePair<S,T> extends Object
Generic key-value pair with optional property map.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected S`
`key`
Pair key.
`protected Map<String,Object>`
`propMap`
Property map.
`protected T`
`value`
Pair value.

## Constructor Summary

Constructors
Constructor
Description
`KeyValuePair(S key, T value)`
Creates a new pair.

## Method Summary

Modifier and Type
Method
Description
`Object`
`get(String propKey)`
Returns the property attached to the specified key.
`S`
`getKey()`
Returns the pair key.
`Map<String,Object>`
`getProps()`
Returns all attached properties.
`T`
`getValue()`
Returns the pair value.
`void`
`set(String propKey, Object propValue)`
Sets the property specified by the key and value.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### key

protected S key
Pair key.

### value

protected T value
Pair value.

### propMap

protected Map<String,Object> propMap
Property map.

## Constructor Details

### KeyValuePair

public KeyValuePair(S key, T value)
Creates a new pair.

Parameters:
  `key` - Pair key.
  `value` - Pair value.

## Method Details

### getValue

public T getValue()
Returns the pair value.

Returns:
  Pair value.

### getKey

public S getKey()
Returns the pair key.

Returns:
  Pair key.

### get

public Object get(String propKey)
Returns the property attached to the specified key.

Parameters:
  `propKey` - Property key.
Returns:
  Attached property.

### set

public void set(String propKey, Object propValue)
Sets the property specified by the key and value.

Parameters:
  `propKey` - Property key.
  `propValue` - Property value.

### getProps

public Map<String,Object> getProps()
Returns all attached properties.

Returns:
  All attached properties.