Package org.apache.avro.specific
Class SpecificRecordBase
java.lang.Object
org.apache.avro.specific.SpecificRecordBase
- All Implemented Interfaces:
Externalizable,Serializable,Comparable<SpecificRecord>,GenericContainer,GenericRecord,IndexedRecord,SpecificRecord
- Direct Known Subclasses:
HandshakeRequest,HandshakeResponse
public abstract class SpecificRecordBase
extends Object
implements SpecificRecord, Comparable<SpecificRecord>, GenericRecord, Externalizable
Base class for generated record classes.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(SpecificRecord that) voidvoidcustomEncode(Encoder out) booleanReturn the value of a field given its name.Conversion<?> getConversion(int field) Conversion<?> getConversion(String fieldName) protected booleanReturns true iff an instance supports theMessageEncoder.encode(D)andMessageDecoder.decode(java.io.InputStream)operations.inthashCode()voidSet the value of a field given its name.voidtoString()voidMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.avro.generic.GenericContainer
getSchemaMethods inherited from interface org.apache.avro.generic.GenericRecord
hasFieldMethods inherited from interface org.apache.avro.generic.IndexedRecord
get, put
-
Constructor Details
-
SpecificRecordBase
public SpecificRecordBase()
-
-
Method Details
-
getSpecificData
-
getConversion
-
put
Description copied from interface:GenericRecordSet the value of a field given its name.- Specified by:
putin interfaceGenericRecord
-
get
Description copied from interface:GenericRecordReturn the value of a field given its name.- Specified by:
getin interfaceGenericRecord
-
getConversion
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<SpecificRecord>
-
toString
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
hasCustomCoders
protected boolean hasCustomCoders()Returns true iff an instance supports theMessageEncoder.encode(D)andMessageDecoder.decode(java.io.InputStream)operations. Should only be used bySpecificDatumReader/Writerto selectively usecustomEncode(org.apache.avro.io.Encoder)andcustomDecode(org.apache.avro.io.ResolvingDecoder)to optimize the (de)serialization of values. -
customEncode
- Throws:
IOException
-
customDecode
- Throws:
IOException
-