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
ConstructorsConstructorDescriptionPair(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 TypeMethodDescriptionintbooleanget(int i) Return the value of a field given its position in the schema.static SchemagetKeySchema(Schema pair) Return a pair's key schema.static SchemagetPairSchema(Schema key, Schema value) Get a pair schema.The schema of this instance.static SchemagetValueSchema(Schema pair) Return a pair's value schema.inthashCode()key()Get the key.voidSet the key.voidSet the value of a field given its position in the schema.voidSet both the key and value.toString()value()Get the value.voidSet 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:GenericContainerThe schema of this instance.- Specified by:
getSchemain 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:
compareToin interfaceComparable<K>
-
toString
-
get
Description copied from interface:IndexedRecordReturn 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
DatumWriterimplementations.- Specified by:
getin interfaceIndexedRecord
-
put
Description copied from interface:IndexedRecordSet 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
DatumReaderimplementations.- Specified by:
putin interfaceIndexedRecord
-