Package org.apache.parquet.avro
Class NewCar
- java.lang.Object
-
- org.apache.avro.specific.SpecificRecordBase
-
- org.apache.parquet.avro.NewCar
-
- 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 NewCar 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 classNewCar.BuilderRecordBuilder for NewCar 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<NewCar>createDecoder(org.apache.avro.message.SchemaStore resolver)Create a new BinaryMessageDecoder instance for this class that uses the specifiedSchemaStore.static NewCarfromByteBuffer(ByteBuffer b)Deserializes a NewCar from a ByteBuffer.Objectget(int field$)StringgetBrand()Gets the value of the 'brand' field.static org.apache.avro.SchemagetClassSchema()static org.apache.avro.message.BinaryMessageDecoder<NewCar>getDecoder()Return the BinaryMessageDecoder instance used by this class.StringgetDescription()Gets the value of the 'description' field.longgetDoors()Gets the value of the 'doors' field.static org.apache.avro.message.BinaryMessageEncoder<NewCar>getEncoder()Return the BinaryMessageEncoder instance used by this class.EnginegetEngine()Gets the value of the 'engine' field.StringgetModel()Gets the value of the 'model' field.intgetOpt()Gets the value of the 'opt' 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 NewCar.BuildernewBuilder()Creates a new NewCar RecordBuilder.static NewCar.BuildernewBuilder(NewCar other)Creates a new NewCar RecordBuilder by copying an existing NewCar instance.static NewCar.BuildernewBuilder(NewCar.Builder other)Creates a new NewCar RecordBuilder by copying an existing Builder.voidput(int field$, Object value$)voidreadExternal(ObjectInput in)voidsetBrand(String value)Sets the value of the 'brand' field.voidsetDescription(String value)Sets the value of the 'description' field.voidsetDoors(long value)Sets the value of the 'doors' field.voidsetEngine(Engine value)Sets the value of the 'engine' field.voidsetModel(String value)Sets the value of the 'model' field.voidsetOpt(int value)Sets the value of the 'opt' 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 NewCar 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
-
NewCar
public NewCar()
Default constructor. Note that this does not initialize fields to their default values from the schema. If that is desired then one should usenewBuilder().
-
NewCar
public NewCar(Long year, String registration, String brand, String model, Vin vin, Long doors, Engine engine, Object optionalExtra, List<Service> serviceHistory, Integer opt, String description)
All-args constructor.- Parameters:
year- The new value for yearregistration- The new value for registrationbrand- The new value for brandmodel- 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 serviceHistoryopt- The new value for optdescription- The new value for description
-
-
Method Detail
-
getClassSchema
public static org.apache.avro.Schema getClassSchema()
-
getEncoder
public static org.apache.avro.message.BinaryMessageEncoder<NewCar> 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<NewCar> 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<NewCar> 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 NewCar 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 NewCar fromByteBuffer(ByteBuffer b) throws IOException
Deserializes a NewCar from a ByteBuffer.- Parameters:
b- a byte buffer holding serialized data for an instance of this class- Returns:
- a NewCar 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.
-
getBrand
public String getBrand()
Gets the value of the 'brand' field.- Returns:
- The value of the 'brand' field.
-
setBrand
public void setBrand(String value)
Sets the value of the 'brand' 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 long getDoors()
Gets the value of the 'doors' field.- Returns:
- The value of the 'doors' field.
-
setDoors
public void setDoors(long 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.
-
getOpt
public int getOpt()
Gets the value of the 'opt' field.- Returns:
- The value of the 'opt' field.
-
setOpt
public void setOpt(int value)
Sets the value of the 'opt' field.- Parameters:
value- the value to set.
-
getDescription
public String getDescription()
Gets the value of the 'description' field.- Returns:
- The value of the 'description' field.
-
setDescription
public void setDescription(String value)
Sets the value of the 'description' field.- Parameters:
value- the value to set.
-
newBuilder
public static NewCar.Builder newBuilder()
Creates a new NewCar RecordBuilder.- Returns:
- A new NewCar RecordBuilder
-
newBuilder
public static NewCar.Builder newBuilder(NewCar.Builder other)
Creates a new NewCar RecordBuilder by copying an existing Builder.- Parameters:
other- The existing builder to copy.- Returns:
- A new NewCar RecordBuilder
-
newBuilder
public static NewCar.Builder newBuilder(NewCar other)
Creates a new NewCar RecordBuilder by copying an existing NewCar instance.- Parameters:
other- The existing instance to copy.- Returns:
- A new NewCar 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
-
-