public abstract class SpecificRecordBase extends Object implements SpecificRecord, Comparable<SpecificRecord>, GenericRecord, Externalizable
Constructor and Description |
---|
SpecificRecordBase() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(SpecificRecord that) |
void |
customDecode(ResolvingDecoder in) |
void |
customEncode(Encoder out) |
boolean |
equals(Object that) |
abstract Object |
get(int field)
Return the value of a field given its position in the schema.
|
Object |
get(String fieldName)
Return the value of a field given its name.
|
Conversion<?> |
getConversion(int field) |
Conversion<?> |
getConversion(String fieldName) |
abstract Schema |
getSchema()
The schema of this instance.
|
SpecificData |
getSpecificData() |
protected boolean |
hasCustomCoders()
Returns true iff an instance supports the
MessageEncoder.encode(D) and
MessageDecoder.decode(java.io.InputStream) operations. |
int |
hashCode() |
abstract void |
put(int field,
Object value)
Set the value of a field given its position in the schema.
|
void |
put(String fieldName,
Object value)
Set the value of a field given its name.
|
void |
readExternal(ObjectInput in) |
String |
toString() |
void |
writeExternal(ObjectOutput out) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
hasField
public abstract Schema getSchema()
GenericContainer
getSchema
in interface GenericContainer
public abstract Object get(int field)
IndexedRecord
This method is not meant to be called by user code, but only by
DatumWriter
implementations.
get
in interface IndexedRecord
public abstract void put(int field, Object value)
IndexedRecord
This method is not meant to be called by user code, but only by
DatumReader
implementations.
put
in interface IndexedRecord
public SpecificData getSpecificData()
public Conversion<?> getConversion(int field)
public void put(String fieldName, Object value)
GenericRecord
put
in interface GenericRecord
public Object get(String fieldName)
GenericRecord
get
in interface GenericRecord
public Conversion<?> getConversion(String fieldName)
public int compareTo(SpecificRecord that)
compareTo
in interface Comparable<SpecificRecord>
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
IOException
protected boolean hasCustomCoders()
MessageEncoder.encode(D)
and
MessageDecoder.decode(java.io.InputStream)
operations. Should only be used by
SpecificDatumReader/Writer
to selectively use
customEncode(org.apache.avro.io.Encoder)
and customDecode(org.apache.avro.io.ResolvingDecoder)
to optimize the
(de)serialization of values.public void customEncode(Encoder out) throws IOException
IOException
public void customDecode(ResolvingDecoder in) throws IOException
IOException
Copyright © 2009–2022 The Apache Software Foundation. All rights reserved.