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`

public abstract class SpecificRecordBase extends Object implements SpecificRecord, Comparable<SpecificRecord>, GenericRecord, Externalizable
Base class for generated record classes.

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`SpecificRecordBase()`

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(SpecificRecord that)`
`void`
`customDecode(ResolvingDecoder in)`
`void`
`customEncode(Encoder out)`
`boolean`
`equals(Object that)`
`Object`
`get(String fieldName)`
Return the value of a field given its name.
`Conversion<?>`
`getConversion(int field)`
`Conversion<?>`
`getConversion(String fieldName)`
`SpecificData`
`getSpecificData()`
`protected boolean`
`hasCustomCoders()`
Returns true iff an instance supports the `MessageEncoder.encode(D)` and `MessageDecoder.decode(java.io.InputStream)` operations.
`int`
`hashCode()`
`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)`

### 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

public SpecificData getSpecificData()

### getConversion

public Conversion<?> getConversion(int field)

### put

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

Specified by:
  `put` in interface `GenericRecord`

### get

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

Specified by:
  `get` in interface `GenericRecord`

### getConversion

public Conversion<?> getConversion(String fieldName)

### equals

public boolean equals(Object that)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### compareTo

public int compareTo(SpecificRecord that)

Specified by:
  `compareTo` in interface `Comparable<SpecificRecord>`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### writeExternal

public void writeExternal(ObjectOutput out) throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

### readExternal

public void readExternal(ObjectInput in) throws IOException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`

### hasCustomCoders

protected boolean hasCustomCoders()
Returns true iff an instance supports the `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.

### customEncode

public void customEncode(Encoder out) throws IOException

Throws:
  `IOException`

### customDecode

public void customDecode(ResolvingDecoder in) throws IOException

Throws:
  `IOException`