public static class GenericData.Record extends Object implements GenericRecord, Comparable<GenericData.Record>
GenericRecord
. Note that this
implementation does not fill in default values for fields if they are not
specified; use GenericRecordBuilder
in that case.GenericRecordBuilder
Constructor and Description |
---|
Record(GenericData.Record other,
boolean deepCopy) |
Record(Schema schema) |
Modifier and Type | Method and Description |
---|---|
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() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
hasField
public Record(Schema schema)
public Record(GenericData.Record other, boolean deepCopy)
public Schema getSchema()
GenericContainer
getSchema
in interface GenericContainer
public void put(String key, Object value)
GenericRecord
put
in interface GenericRecord
public void put(int i, Object v)
IndexedRecord
This method is not meant to be called by user code, but only by
DatumReader
implementations.
put
in interface IndexedRecord
public Object get(String key)
GenericRecord
get
in interface GenericRecord
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 int compareTo(GenericData.Record that)
compareTo
in interface Comparable<GenericData.Record>
Copyright © 2009–2023 The Apache Software Foundation. All rights reserved.