Package org.apache.parquet.avro
Class Car
- java.lang.Object
-
- org.apache.avro.specific.SpecificRecordBase
-
- org.apache.parquet.avro.Car
-
- All Implemented Interfaces:
Externalizable,Serializable,Comparable<org.apache.avro.specific.SpecificRecord>,org.apache.avro.generic.GenericContainer,org.apache.avro.generic.GenericRecord,org.apache.avro.generic.IndexedRecord,org.apache.avro.specific.SpecificRecord
public class Car extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCar.BuilderRecordBuilder for Car instances.
-
Field Summary
Fields Modifier and Type Field Description static org.apache.avro.SchemaSCHEMA$
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.apache.avro.message.BinaryMessageDecoder<Car>createDecoder(org.apache.avro.message.SchemaStore resolver)Create a new BinaryMessageDecoder instance for this class that uses the specifiedSchemaStore.static CarfromByteBuffer(ByteBuffer b)Deserializes a Car from a ByteBuffer.Objectget(int field$)static org.apache.avro.SchemagetClassSchema()static org.apache.avro.message.BinaryMessageDecoder<Car>getDecoder()Return the BinaryMessageDecoder instance used by this class.intgetDoors()Gets the value of the 'doors' field.static org.apache.avro.message.BinaryMessageEncoder<Car>getEncoder()Return the BinaryMessageEncoder instance used by this class.EnginegetEngine()Gets the value of the 'engine' field.StringgetMake()Gets the value of the 'make' field.StringgetModel()Gets the value of the 'model' field.ObjectgetOptionalExtra()Gets the value of the 'optionalExtra' field.StringgetRegistration()Gets the value of the 'registration' field.org.apache.avro.SchemagetSchema()List<Service>getServiceHistory()Gets the value of the 'serviceHistory' field.org.apache.avro.specific.SpecificDatagetSpecificData()VingetVin()Gets the value of the 'vin' field.longgetYear()Gets the value of the 'year' field.static Car.BuildernewBuilder()Creates a new Car RecordBuilder.static Car.BuildernewBuilder(Car other)Creates a new Car RecordBuilder by copying an existing Car instance.static Car.BuildernewBuilder(Car.Builder other)Creates a new Car RecordBuilder by copying an existing Builder.voidput(int field$, Object value$)voidreadExternal(ObjectInput in)voidsetDoors(int value)Sets the value of the 'doors' field.voidsetEngine(Engine value)Sets the value of the 'engine' field.voidsetMake(String value)Sets the value of the 'make' field.voidsetModel(String value)Sets the value of the 'model' field.voidsetOptionalExtra(Object value)Sets the value of the 'optionalExtra' field.voidsetRegistration(String value)Sets the value of the 'registration' field.voidsetServiceHistory(List<Service> value)Sets the value of the 'serviceHistory' field.voidsetVin(Vin value)Sets the value of the 'vin' field.voidsetYear(long value)Sets the value of the 'year' field.ByteBuffertoByteBuffer()Serializes this Car to a ByteBuffer.voidwriteExternal(ObjectOutput out)-
Methods inherited from class org.apache.avro.specific.SpecificRecordBase
compareTo, customDecode, customEncode, equals, get, getConversion, getConversion, hasCustomCoders, hashCode, put, toString
-
-
-
-
Constructor Detail
-
Car
public Car()
Default constructor. Note that this does not initialize fields to their default values from the schema. If that is desired then one should usenewBuilder().
-
Car
public Car(Long year, String registration, String make, String model, Vin vin, Integer doors, Engine engine, Object optionalExtra, List<Service> serviceHistory)
All-args constructor.- Parameters:
year- The new value for yearregistration- The new value for registrationmake- The new value for makemodel- The new value for modelvin- The new value for vindoors- The new value for doorsengine- The new value for engineoptionalExtra- The new value for optionalExtraserviceHistory- The new value for serviceHistory
-
-
Method Detail
-
getClassSchema
public static org.apache.avro.Schema getClassSchema()
-
getEncoder
public static org.apache.avro.message.BinaryMessageEncoder<Car> getEncoder()
Return the BinaryMessageEncoder instance used by this class.- Returns:
- the message encoder used by this class
-
getDecoder
public static org.apache.avro.message.BinaryMessageDecoder<Car> getDecoder()
Return the BinaryMessageDecoder instance used by this class.- Returns:
- the message decoder used by this class
-
createDecoder
public static org.apache.avro.message.BinaryMessageDecoder<Car> createDecoder(org.apache.avro.message.SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specifiedSchemaStore.- Parameters:
resolver- aSchemaStoreused to find schemas by fingerprint- Returns:
- a BinaryMessageDecoder instance for this class backed by the given SchemaStore
-
toByteBuffer
public ByteBuffer toByteBuffer() throws IOException
Serializes this Car to a ByteBuffer.- Returns:
- a buffer holding the serialized data for this instance
- Throws:
IOException- if this instance could not be serialized
-
fromByteBuffer
public static Car fromByteBuffer(ByteBuffer b) throws IOException
Deserializes a Car from a ByteBuffer.- Parameters:
b- a byte buffer holding serialized data for an instance of this class- Returns:
- a Car instance decoded from the given buffer
- Throws:
IOException- if the given bytes could not be deserialized into an instance of this class
-
getSpecificData
public org.apache.avro.specific.SpecificData getSpecificData()
- Overrides:
getSpecificDatain classorg.apache.avro.specific.SpecificRecordBase
-
getSchema
public org.apache.avro.Schema getSchema()
- Specified by:
getSchemain interfaceorg.apache.avro.generic.GenericContainer- Specified by:
getSchemain classorg.apache.avro.specific.SpecificRecordBase
-
get
public Object get(int field$)
- Specified by:
getin interfaceorg.apache.avro.generic.IndexedRecord- Specified by:
getin classorg.apache.avro.specific.SpecificRecordBase
-
put
public void put(int field$, Object value$)- Specified by:
putin interfaceorg.apache.avro.generic.IndexedRecord- Specified by:
putin classorg.apache.avro.specific.SpecificRecordBase
-
getYear
public long getYear()
Gets the value of the 'year' field.- Returns:
- The value of the 'year' field.
-
setYear
public void setYear(long value)
Sets the value of the 'year' field.- Parameters:
value- the value to set.
-
getRegistration
public String getRegistration()
Gets the value of the 'registration' field.- Returns:
- The value of the 'registration' field.
-
setRegistration
public void setRegistration(String value)
Sets the value of the 'registration' field.- Parameters:
value- the value to set.
-
getMake
public String getMake()
Gets the value of the 'make' field.- Returns:
- The value of the 'make' field.
-
setMake
public void setMake(String value)
Sets the value of the 'make' field.- Parameters:
value- the value to set.
-
getModel
public String getModel()
Gets the value of the 'model' field.- Returns:
- The value of the 'model' field.
-
setModel
public void setModel(String value)
Sets the value of the 'model' field.- Parameters:
value- the value to set.
-
getVin
public Vin getVin()
Gets the value of the 'vin' field.- Returns:
- The value of the 'vin' field.
-
setVin
public void setVin(Vin value)
Sets the value of the 'vin' field.- Parameters:
value- the value to set.
-
getDoors
public int getDoors()
Gets the value of the 'doors' field.- Returns:
- The value of the 'doors' field.
-
setDoors
public void setDoors(int value)
Sets the value of the 'doors' field.- Parameters:
value- the value to set.
-
getEngine
public Engine getEngine()
Gets the value of the 'engine' field.- Returns:
- The value of the 'engine' field.
-
setEngine
public void setEngine(Engine value)
Sets the value of the 'engine' field.- Parameters:
value- the value to set.
-
getOptionalExtra
public Object getOptionalExtra()
Gets the value of the 'optionalExtra' field.- Returns:
- The value of the 'optionalExtra' field.
-
setOptionalExtra
public void setOptionalExtra(Object value)
Sets the value of the 'optionalExtra' field.- Parameters:
value- the value to set.
-
getServiceHistory
public List<Service> getServiceHistory()
Gets the value of the 'serviceHistory' field.- Returns:
- The value of the 'serviceHistory' field.
-
setServiceHistory
public void setServiceHistory(List<Service> value)
Sets the value of the 'serviceHistory' field.- Parameters:
value- the value to set.
-
newBuilder
public static Car.Builder newBuilder()
Creates a new Car RecordBuilder.- Returns:
- A new Car RecordBuilder
-
newBuilder
public static Car.Builder newBuilder(Car.Builder other)
Creates a new Car RecordBuilder by copying an existing Builder.- Parameters:
other- The existing builder to copy.- Returns:
- A new Car RecordBuilder
-
newBuilder
public static Car.Builder newBuilder(Car other)
Creates a new Car RecordBuilder by copying an existing Car instance.- Parameters:
other- The existing instance to copy.- Returns:
- A new Car RecordBuilder
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classorg.apache.avro.specific.SpecificRecordBase- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classorg.apache.avro.specific.SpecificRecordBase- Throws:
IOException
-
-