Package org.apache.avro.mapred

# Class Pair<K,V>

java.lang.Object
org.apache.avro.mapred.Pair<K,V>

All Implemented Interfaces:
  `Comparable<Pair>`, `org.apache.avro.generic.GenericContainer`, `org.apache.avro.generic.IndexedRecord`, `org.apache.avro.specific.SpecificData.SchemaConstructable`

public class Pair<K,V> extends Object implements org.apache.avro.generic.IndexedRecord, Comparable<Pair>, org.apache.avro.specific.SpecificData.SchemaConstructable
A key/value pair.

## Constructor Summary

Constructors
Constructor
Description
`Pair(CharSequence key, CharSequence value)`
`Pair(CharSequence key, Double value)`
`Pair(CharSequence key, Float value)`
`Pair(CharSequence key, Integer value)`
`Pair(CharSequence key, Long value)`
`Pair(CharSequence key, Object value)`
`Pair(CharSequence key, Void value)`
`Pair(CharSequence key, ByteBuffer value)`
`Pair(CharSequence key, org.apache.avro.generic.GenericContainer value)`
`Pair(Double key, CharSequence value)`
`Pair(Double key, Double value)`
`Pair(Double key, Float value)`
`Pair(Double key, Integer value)`
`Pair(Double key, Long value)`
`Pair(Double key, Object value)`
`Pair(Double key, Void value)`
`Pair(Double key, ByteBuffer value)`
`Pair(Double key, org.apache.avro.generic.GenericContainer value)`
`Pair(Float key, CharSequence value)`
`Pair(Float key, Double value)`
`Pair(Float key, Float value)`
`Pair(Float key, Integer value)`
`Pair(Float key, Long value)`
`Pair(Float key, Object value)`
`Pair(Float key, Void value)`
`Pair(Float key, ByteBuffer value)`
`Pair(Float key, org.apache.avro.generic.GenericContainer value)`
`Pair(Integer key, CharSequence value)`
`Pair(Integer key, Double value)`
`Pair(Integer key, Float value)`
`Pair(Integer key, Integer value)`
`Pair(Integer key, Long value)`
`Pair(Integer key, Object value)`
`Pair(Integer key, Void value)`
`Pair(Integer key, ByteBuffer value)`
`Pair(Integer key, org.apache.avro.generic.GenericContainer value)`
`Pair(Long key, CharSequence value)`
`Pair(Long key, Double value)`
`Pair(Long key, Float value)`
`Pair(Long key, Integer value)`
`Pair(Long key, Long value)`
`Pair(Long key, Object value)`
`Pair(Long key, Void value)`
`Pair(Long key, ByteBuffer value)`
`Pair(Long key, org.apache.avro.generic.GenericContainer value)`
`Pair(Object key, CharSequence value)`
`Pair(Object key, Double value)`
`Pair(Object key, Float value)`
`Pair(Object key, Integer value)`
`Pair(Object key, Long value)`
`Pair(Object key, Object value)`
`Pair(Object key, Void value)`
`Pair(Object key, ByteBuffer value)`
`Pair(Object key, org.apache.avro.generic.GenericContainer value)`
`Pair(Void key, CharSequence value)`
`Pair(Void key, Double value)`
`Pair(Void key, Float value)`
`Pair(Void key, Integer value)`
`Pair(Void key, Long value)`
`Pair(Void key, Object value)`
`Pair(Void key, Void value)`
`Pair(Void key, ByteBuffer value)`
`Pair(Void key, org.apache.avro.generic.GenericContainer value)`
`Pair(ByteBuffer key, CharSequence value)`
`Pair(ByteBuffer key, Double value)`
`Pair(ByteBuffer key, Float value)`
`Pair(ByteBuffer key, Integer value)`
`Pair(ByteBuffer key, Long value)`
`Pair(ByteBuffer key, Object value)`
`Pair(ByteBuffer key, Void value)`
`Pair(ByteBuffer key, ByteBuffer value)`
`Pair(ByteBuffer key, org.apache.avro.generic.GenericContainer value)`
`Pair(K key, org.apache.avro.Schema keySchema, V value, org.apache.avro.Schema valueSchema)`
`Pair(org.apache.avro.generic.GenericContainer key, CharSequence value)`
`Pair(org.apache.avro.generic.GenericContainer key, Double value)`
`Pair(org.apache.avro.generic.GenericContainer key, Float value)`
`Pair(org.apache.avro.generic.GenericContainer key, Integer value)`
`Pair(org.apache.avro.generic.GenericContainer key, Long value)`
`Pair(org.apache.avro.generic.GenericContainer key, Object value)`
`Pair(org.apache.avro.generic.GenericContainer key, Void value)`
`Pair(org.apache.avro.generic.GenericContainer key, ByteBuffer value)`
`Pair(org.apache.avro.generic.GenericContainer key, org.apache.avro.generic.GenericContainer value)`
`Pair(org.apache.avro.Schema schema)`

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(Pair that)`
`boolean`
`equals(Object o)`
`Object`
`get(int i)`
`static org.apache.avro.Schema`
`getKeySchema(org.apache.avro.Schema pair)`
Return a pair's key schema.
`static org.apache.avro.Schema`
`getPairSchema(org.apache.avro.Schema key, org.apache.avro.Schema value)`
Get a pair schema.
`org.apache.avro.Schema`
`getSchema()`
`static org.apache.avro.Schema`
`getValueSchema(org.apache.avro.Schema pair)`
Return a pair's value schema.
`int`
`hashCode()`
`K`
`key()`
Get the key.
`void`
`key(K key)`
Set the key.
`void`
`put(int i, Object o)`
`void`
`set(K key, V value)`
Set both the key and value.
`String`
`toString()`
`V`
`value()`
Get the value.
`void`
`value(V value)`
Set the value.

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

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### Pair

public Pair(org.apache.avro.Schema schema)

### Pair

public Pair(K key, org.apache.avro.Schema keySchema, V value, org.apache.avro.Schema valueSchema)

### Pair

public Pair(Object key, Object value)

### Pair

public Pair(Object key, org.apache.avro.generic.GenericContainer value)

### Pair

public Pair(Object key, CharSequence value)

### Pair

public Pair(Object key, ByteBuffer value)

### Pair

public Pair(Object key, Integer value)

### Pair

public Pair(Object key, Long value)

### Pair

public Pair(Object key, Float value)

### Pair

public Pair(Object key, Double value)

### Pair

public Pair(Object key, Void value)

### Pair

public Pair(org.apache.avro.generic.GenericContainer key, Object value)

### Pair

public Pair(org.apache.avro.generic.GenericContainer key, org.apache.avro.generic.GenericContainer value)

### Pair

public Pair(org.apache.avro.generic.GenericContainer key, CharSequence value)

### Pair

public Pair(org.apache.avro.generic.GenericContainer key, ByteBuffer value)

### Pair

public Pair(org.apache.avro.generic.GenericContainer key, Integer value)

### Pair

public Pair(org.apache.avro.generic.GenericContainer key, Long value)

### Pair

public Pair(org.apache.avro.generic.GenericContainer key, Float value)

### Pair

public Pair(org.apache.avro.generic.GenericContainer key, Double value)

### Pair

public Pair(org.apache.avro.generic.GenericContainer key, Void value)

### Pair

public Pair(CharSequence key, Object value)

### Pair

public Pair(CharSequence key, org.apache.avro.generic.GenericContainer value)

### Pair

public Pair(CharSequence key, CharSequence value)

### Pair

public Pair(CharSequence key, ByteBuffer value)

### Pair

public Pair(CharSequence key, Integer value)

### Pair

public Pair(CharSequence key, Long value)

### Pair

public Pair(CharSequence key, Float value)

### Pair

public Pair(CharSequence key, Double value)

### Pair

public Pair(CharSequence key, Void value)

### Pair

public Pair(ByteBuffer key, Object value)

### Pair

public Pair(ByteBuffer key, org.apache.avro.generic.GenericContainer value)

### Pair

public Pair(ByteBuffer key, CharSequence value)

### Pair

public Pair(ByteBuffer key, ByteBuffer value)

### Pair

public Pair(ByteBuffer key, Integer value)

### Pair

public Pair(ByteBuffer key, Long value)

### Pair

public Pair(ByteBuffer key, Float value)

### Pair

public Pair(ByteBuffer key, Double value)

### Pair

public Pair(ByteBuffer key, Void value)

### Pair

public Pair(Integer key, Object value)

### Pair

public Pair(Integer key, org.apache.avro.generic.GenericContainer value)

### Pair

public Pair(Integer key, CharSequence value)

### Pair

public Pair(Integer key, ByteBuffer value)

### Pair

public Pair(Integer key, Integer value)

### Pair

public Pair(Integer key, Long value)

### Pair

public Pair(Integer key, Float value)

### Pair

public Pair(Integer key, Double value)

### Pair

public Pair(Integer key, Void value)

### Pair

public Pair(Long key, Object value)

### Pair

public Pair(Long key, org.apache.avro.generic.GenericContainer value)

### Pair

public Pair(Long key, CharSequence value)

### Pair

public Pair(Long key, ByteBuffer value)

### Pair

public Pair(Long key, Integer value)

### Pair

public Pair(Long key, Long value)

### Pair

public Pair(Long key, Float value)

### Pair

public Pair(Long key, Double value)

### Pair

public Pair(Long key, Void value)

### Pair

public Pair(Float key, Object value)

### Pair

public Pair(Float key, org.apache.avro.generic.GenericContainer value)

### Pair

public Pair(Float key, CharSequence value)

### Pair

public Pair(Float key, ByteBuffer value)

### Pair

public Pair(Float key, Integer value)

### Pair

public Pair(Float key, Long value)

### Pair

public Pair(Float key, Float value)

### Pair

public Pair(Float key, Double value)

### Pair

public Pair(Float key, Void value)

### Pair

public Pair(Double key, Object value)

### Pair

public Pair(Double key, org.apache.avro.generic.GenericContainer value)

### Pair

public Pair(Double key, CharSequence value)

### Pair

public Pair(Double key, ByteBuffer value)

### Pair

public Pair(Double key, Integer value)

### Pair

public Pair(Double key, Long value)

### Pair

public Pair(Double key, Float value)

### Pair

public Pair(Double key, Double value)

### Pair

public Pair(Double key, Void value)

### Pair

public Pair(Void key, Object value)

### Pair

public Pair(Void key, org.apache.avro.generic.GenericContainer value)

### Pair

public Pair(Void key, CharSequence value)

### Pair

public Pair(Void key, ByteBuffer value)

### Pair

public Pair(Void key, Integer value)

### Pair

public Pair(Void key, Long value)

### Pair

public Pair(Void key, Float value)

### Pair

public Pair(Void key, Double value)

### Pair

public Pair(Void key, Void value)

## Method Details

### getKeySchema

public static org.apache.avro.Schema getKeySchema(org.apache.avro.Schema pair)
Return a pair's key schema.

### getValueSchema

public static org.apache.avro.Schema getValueSchema(org.apache.avro.Schema pair)
Return a pair's value schema.

### getPairSchema

public static org.apache.avro.Schema getPairSchema(org.apache.avro.Schema key, org.apache.avro.Schema value)
Get a pair schema.

### getSchema

public org.apache.avro.Schema getSchema()

Specified by:
  `getSchema` in interface `org.apache.avro.generic.GenericContainer`

### key

public K key()
Get the key.

### key

public void key(K key)
Set the key.

### value

public V value()
Get the value.

### value

public void value(V value)
Set the value.

### set

public void set(K key, V value)
Set both the key and value.

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### compareTo

public int compareTo(Pair that)

Specified by:
  `compareTo` in interface `Comparable<K>`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### get

public Object get(int i)

Specified by:
  `get` in interface `org.apache.avro.generic.IndexedRecord`

### put

public void put(int i, Object o)

Specified by:
  `put` in interface `org.apache.avro.generic.IndexedRecord`