org.apache.avro.generic
Class GenericData.Record

java.lang.Object
  extended by org.apache.avro.generic.GenericData.Record
All Implemented Interfaces:
Comparable<GenericData.Record>, GenericContainer, GenericRecord, IndexedRecord
Enclosing class:
GenericData

public static class GenericData.Record
extends Object
implements GenericRecord, Comparable<GenericData.Record>

Default implementation of GenericRecord.


Constructor Summary
GenericData.Record(Schema schema)
           
 
Method Summary
 int compareTo(GenericData.Record that)
           
 boolean equals(Object o)
           
 Object get(int i)
          Return the value of a field given its position in the schema.
 Object get(String key)
          Return the value of a field given its name.
 Schema getSchema()
          The schema of this instance.
 int hashCode()
           
 void put(int i, Object v)
          Set the value of a field given its position in the schema.
 void put(String key, Object value)
          Set the value of a field given its name.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GenericData.Record

public GenericData.Record(Schema schema)
Method Detail

getSchema

public Schema getSchema()
Description copied from interface: GenericContainer
The schema of this instance.

Specified by:
getSchema in interface GenericContainer

put

public void put(String key,
                Object value)
Description copied from interface: GenericRecord
Set the value of a field given its name.

Specified by:
put in interface GenericRecord

put

public void put(int i,
                Object v)
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 interface IndexedRecord

get

public Object get(String key)
Description copied from interface: GenericRecord
Return the value of a field given its name.

Specified by:
get in interface GenericRecord

get

public Object get(int i)
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 interface IndexedRecord

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(GenericData.Record that)
Specified by:
compareTo in interface Comparable<GenericData.Record>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.