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
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(SpecificRecord that) void
void
customEncode
(Encoder out) boolean
Return the value of a field given its name.Conversion
<?> getConversion
(int field) Conversion
<?> getConversion
(String fieldName) protected boolean
Returns true iff an instance supports theMessageEncoder.encode(D)
andMessageDecoder.decode(java.io.InputStream)
operations.int
hashCode()
void
Set the value of a field given its name.void
toString()
void
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.avro.generic.GenericContainer
getSchema
Methods inherited from interface org.apache.avro.generic.GenericRecord
hasField
Methods inherited from interface org.apache.avro.generic.IndexedRecord
get, put
-
Constructor Details
-
SpecificRecordBase
public SpecificRecordBase()
-
-
Method Details
-
getSpecificData
-
getConversion
-
put
Description copied from interface:GenericRecord
Set the value of a field given its name.- Specified by:
put
in interfaceGenericRecord
-
get
Description copied from interface:GenericRecord
Return the value of a field given its name.- Specified by:
get
in interfaceGenericRecord
-
getConversion
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<SpecificRecord>
-
toString
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in 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/Writer
to 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
-