public class Pair<K,V> extends Object implements IndexedRecord, Comparable<Pair>, SpecificData.SchemaConstructable
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Pair that) |
boolean |
equals(Object o) |
Object |
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.
|
Schema |
getSchema()
The schema of this instance.
|
static Schema |
getValueSchema(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)
Set the value of a field given its position in the schema.
|
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.
|
public Pair(Schema schema)
public Pair(Object key, GenericContainer value)
public Pair(Object key, CharSequence value)
public Pair(Object key, ByteBuffer value)
public Pair(GenericContainer key, Object value)
public Pair(GenericContainer key, GenericContainer value)
public Pair(GenericContainer key, CharSequence value)
public Pair(GenericContainer key, ByteBuffer value)
public Pair(GenericContainer key, Integer value)
public Pair(GenericContainer key, Long value)
public Pair(GenericContainer key, Float value)
public Pair(GenericContainer key, Double value)
public Pair(GenericContainer key, Void value)
public Pair(CharSequence key, Object value)
public Pair(CharSequence key, GenericContainer value)
public Pair(CharSequence key, CharSequence value)
public Pair(CharSequence key, ByteBuffer value)
public Pair(CharSequence key, Integer value)
public Pair(CharSequence key, Long value)
public Pair(CharSequence key, Float value)
public Pair(CharSequence key, Double value)
public Pair(CharSequence key, Void value)
public Pair(ByteBuffer key, Object value)
public Pair(ByteBuffer key, GenericContainer value)
public Pair(ByteBuffer key, CharSequence value)
public Pair(ByteBuffer key, ByteBuffer value)
public Pair(ByteBuffer key, Integer value)
public Pair(ByteBuffer key, Long value)
public Pair(ByteBuffer key, Float value)
public Pair(ByteBuffer key, Double value)
public Pair(ByteBuffer key, Void value)
public Pair(Integer key, GenericContainer value)
public Pair(Integer key, CharSequence value)
public Pair(Integer key, ByteBuffer value)
public Pair(Long key, GenericContainer value)
public Pair(Long key, CharSequence value)
public Pair(Long key, ByteBuffer value)
public Pair(Float key, GenericContainer value)
public Pair(Float key, CharSequence value)
public Pair(Float key, ByteBuffer value)
public Pair(Double key, GenericContainer value)
public Pair(Double key, CharSequence value)
public Pair(Double key, ByteBuffer value)
public Pair(Void key, GenericContainer value)
public Pair(Void key, CharSequence value)
public Pair(Void key, ByteBuffer value)
public Schema getSchema()
GenericContainer
getSchema
in interface GenericContainer
public K key()
public void key(K key)
public V value()
public void value(V value)
public int compareTo(Pair that)
compareTo
in interface Comparable<Pair>
public Object get(int i)
IndexedRecord
This method is not meant to be called by user code, but only by DatumWriter
implementations.
get
in interface IndexedRecord
public void put(int i, Object o)
IndexedRecord
This method is not meant to be called by user code, but only by DatumReader
implementations.
put
in interface IndexedRecord
Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.