Package org.apache.avro.mapred
Class Pair<K,V>
java.lang.Object
org.apache.avro.mapred.Pair<K,V>
- All Implemented Interfaces:
Comparable<Pair>
,GenericContainer
,IndexedRecord
,SpecificData.SchemaConstructable
public class Pair<K,V>
extends Object
implements IndexedRecord, Comparable<Pair>, SpecificData.SchemaConstructable
A key/value pair.
-
Constructor Summary
ConstructorDescriptionPair
(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, GenericContainer value) Pair
(Double key, CharSequence value) Pair
(Double key, ByteBuffer value) Pair
(Double key, GenericContainer value) Pair
(Float key, CharSequence value) Pair
(Float key, ByteBuffer value) Pair
(Float key, GenericContainer value) Pair
(Integer key, CharSequence value) Pair
(Integer key, ByteBuffer value) Pair
(Integer key, GenericContainer value) Pair
(Long key, CharSequence value) Pair
(Long key, ByteBuffer value) Pair
(Long key, GenericContainer value) Pair
(Object key, CharSequence value) Pair
(Object key, ByteBuffer value) Pair
(Object key, GenericContainer value) Pair
(Void key, CharSequence value) Pair
(Void key, ByteBuffer value) Pair
(Void key, 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, GenericContainer value) Pair
(GenericContainer key, CharSequence value) Pair
(GenericContainer key, Double value) Pair
(GenericContainer key, Float value) Pair
(GenericContainer key, Integer value) Pair
(GenericContainer key, Long value) Pair
(GenericContainer key, Object value) Pair
(GenericContainer key, Void value) Pair
(GenericContainer key, ByteBuffer value) Pair
(GenericContainer key, GenericContainer value) -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
get
(int i) Return the value of a field given its position in the schema.static Schema
getKeySchema
(Schema pair) Return a pair's key schema.static Schema
getPairSchema
(Schema key, Schema value) Get a pair schema.The schema of this instance.static Schema
getValueSchema
(Schema pair) Return a pair's value schema.int
hashCode()
key()
Get the key.void
Set the key.void
Set the value of a field given its position in the schema.void
Set both the key and value.toString()
value()
Get the value.void
Set the value.
-
Constructor Details
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
Pair
-
-
Method Details
-
getKeySchema
Return a pair's key schema. -
getValueSchema
Return a pair's value schema. -
getPairSchema
Get a pair schema. -
getSchema
Description copied from interface:GenericContainer
The schema of this instance.- Specified by:
getSchema
in interfaceGenericContainer
-
key
Get the key. -
key
Set the key. -
value
Get the value. -
value
Set the value. -
set
Set both the key and value. -
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<K>
-
toString
-
get
Description copied from interface:IndexedRecord
Return the value of a field given its position in the schema.This method is not meant to be called by user code, but only by
DatumWriter
implementations.- Specified by:
get
in interfaceIndexedRecord
-
put
Description copied from interface:IndexedRecord
Set the value of a field given its position in the schema.This method is not meant to be called by user code, but only by
DatumReader
implementations.- Specified by:
put
in interfaceIndexedRecord
-