parquet.avro.Car Maven / Gradle / Ivy
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package parquet.avro;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class Car extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Car\",\"namespace\":\"parquet.avro\",\"fields\":[{\"name\":\"year\",\"type\":\"long\"},{\"name\":\"registration\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"make\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"model\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"vin\",\"type\":{\"type\":\"fixed\",\"name\":\"Vin\",\"size\":17}},{\"name\":\"doors\",\"type\":\"int\"},{\"name\":\"engine\",\"type\":{\"type\":\"record\",\"name\":\"Engine\",\"fields\":[{\"name\":\"type\",\"type\":{\"type\":\"enum\",\"name\":\"EngineType\",\"symbols\":[\"DIESEL\",\"PETROL\",\"ELECTRIC\"]}},{\"name\":\"capacity\",\"type\":\"float\"},{\"name\":\"hasTurboCharger\",\"type\":\"boolean\"}]}},{\"name\":\"optionalExtra\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"Stereo\",\"fields\":[{\"name\":\"make\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"speakers\",\"type\":\"int\"}]},{\"type\":\"record\",\"name\":\"LeatherTrim\",\"fields\":[{\"name\":\"colour\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}],\"default\":null},{\"name\":\"serviceHistory\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"Service\",\"fields\":[{\"name\":\"date\",\"type\":\"long\"},{\"name\":\"mechanic\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}}],\"default\":null}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
@Deprecated public long year;
@Deprecated public java.lang.String registration;
@Deprecated public java.lang.String make;
@Deprecated public java.lang.String model;
@Deprecated public parquet.avro.Vin vin;
@Deprecated public int doors;
@Deprecated public parquet.avro.Engine engine;
@Deprecated public java.lang.Object optionalExtra;
@Deprecated public java.util.List serviceHistory;
/**
* Default constructor. Note that this does not initialize fields
* to their default values from the schema. If that is desired then
* one should use newBuilder()
.
*/
public Car() {}
/**
* All-args constructor.
*/
public Car(java.lang.Long year, java.lang.String registration, java.lang.String make, java.lang.String model, parquet.avro.Vin vin, java.lang.Integer doors, parquet.avro.Engine engine, java.lang.Object optionalExtra, java.util.List serviceHistory) {
this.year = year;
this.registration = registration;
this.make = make;
this.model = model;
this.vin = vin;
this.doors = doors;
this.engine = engine;
this.optionalExtra = optionalExtra;
this.serviceHistory = serviceHistory;
}
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
// Used by DatumWriter. Applications should not call.
public java.lang.Object get(int field$) {
switch (field$) {
case 0: return year;
case 1: return registration;
case 2: return make;
case 3: return model;
case 4: return vin;
case 5: return doors;
case 6: return engine;
case 7: return optionalExtra;
case 8: return serviceHistory;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
// Used by DatumReader. Applications should not call.
@SuppressWarnings(value="unchecked")
public void put(int field$, java.lang.Object value$) {
switch (field$) {
case 0: year = (java.lang.Long)value$; break;
case 1: registration = (java.lang.String)value$; break;
case 2: make = (java.lang.String)value$; break;
case 3: model = (java.lang.String)value$; break;
case 4: vin = (parquet.avro.Vin)value$; break;
case 5: doors = (java.lang.Integer)value$; break;
case 6: engine = (parquet.avro.Engine)value$; break;
case 7: optionalExtra = (java.lang.Object)value$; break;
case 8: serviceHistory = (java.util.List)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'year' field.
*/
public java.lang.Long getYear() {
return year;
}
/**
* Sets the value of the 'year' field.
* @param value the value to set.
*/
public void setYear(java.lang.Long value) {
this.year = value;
}
/**
* Gets the value of the 'registration' field.
*/
public java.lang.String getRegistration() {
return registration;
}
/**
* Sets the value of the 'registration' field.
* @param value the value to set.
*/
public void setRegistration(java.lang.String value) {
this.registration = value;
}
/**
* Gets the value of the 'make' field.
*/
public java.lang.String getMake() {
return make;
}
/**
* Sets the value of the 'make' field.
* @param value the value to set.
*/
public void setMake(java.lang.String value) {
this.make = value;
}
/**
* Gets the value of the 'model' field.
*/
public java.lang.String getModel() {
return model;
}
/**
* Sets the value of the 'model' field.
* @param value the value to set.
*/
public void setModel(java.lang.String value) {
this.model = value;
}
/**
* Gets the value of the 'vin' field.
*/
public parquet.avro.Vin getVin() {
return vin;
}
/**
* Sets the value of the 'vin' field.
* @param value the value to set.
*/
public void setVin(parquet.avro.Vin value) {
this.vin = value;
}
/**
* Gets the value of the 'doors' field.
*/
public java.lang.Integer getDoors() {
return doors;
}
/**
* Sets the value of the 'doors' field.
* @param value the value to set.
*/
public void setDoors(java.lang.Integer value) {
this.doors = value;
}
/**
* Gets the value of the 'engine' field.
*/
public parquet.avro.Engine getEngine() {
return engine;
}
/**
* Sets the value of the 'engine' field.
* @param value the value to set.
*/
public void setEngine(parquet.avro.Engine value) {
this.engine = value;
}
/**
* Gets the value of the 'optionalExtra' field.
*/
public java.lang.Object getOptionalExtra() {
return optionalExtra;
}
/**
* Sets the value of the 'optionalExtra' field.
* @param value the value to set.
*/
public void setOptionalExtra(java.lang.Object value) {
this.optionalExtra = value;
}
/**
* Gets the value of the 'serviceHistory' field.
*/
public java.util.List getServiceHistory() {
return serviceHistory;
}
/**
* Sets the value of the 'serviceHistory' field.
* @param value the value to set.
*/
public void setServiceHistory(java.util.List value) {
this.serviceHistory = value;
}
/** Creates a new Car RecordBuilder */
public static parquet.avro.Car.Builder newBuilder() {
return new parquet.avro.Car.Builder();
}
/** Creates a new Car RecordBuilder by copying an existing Builder */
public static parquet.avro.Car.Builder newBuilder(parquet.avro.Car.Builder other) {
return new parquet.avro.Car.Builder(other);
}
/** Creates a new Car RecordBuilder by copying an existing Car instance */
public static parquet.avro.Car.Builder newBuilder(parquet.avro.Car other) {
return new parquet.avro.Car.Builder(other);
}
/**
* RecordBuilder for Car instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private long year;
private java.lang.String registration;
private java.lang.String make;
private java.lang.String model;
private parquet.avro.Vin vin;
private int doors;
private parquet.avro.Engine engine;
private java.lang.Object optionalExtra;
private java.util.List serviceHistory;
/** Creates a new Builder */
private Builder() {
super(parquet.avro.Car.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(parquet.avro.Car.Builder other) {
super(other);
if (isValidValue(fields()[0], other.year)) {
this.year = data().deepCopy(fields()[0].schema(), other.year);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.registration)) {
this.registration = data().deepCopy(fields()[1].schema(), other.registration);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.make)) {
this.make = data().deepCopy(fields()[2].schema(), other.make);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.model)) {
this.model = data().deepCopy(fields()[3].schema(), other.model);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.vin)) {
this.vin = data().deepCopy(fields()[4].schema(), other.vin);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.doors)) {
this.doors = data().deepCopy(fields()[5].schema(), other.doors);
fieldSetFlags()[5] = true;
}
if (isValidValue(fields()[6], other.engine)) {
this.engine = data().deepCopy(fields()[6].schema(), other.engine);
fieldSetFlags()[6] = true;
}
if (isValidValue(fields()[7], other.optionalExtra)) {
this.optionalExtra = data().deepCopy(fields()[7].schema(), other.optionalExtra);
fieldSetFlags()[7] = true;
}
if (isValidValue(fields()[8], other.serviceHistory)) {
this.serviceHistory = data().deepCopy(fields()[8].schema(), other.serviceHistory);
fieldSetFlags()[8] = true;
}
}
/** Creates a Builder by copying an existing Car instance */
private Builder(parquet.avro.Car other) {
super(parquet.avro.Car.SCHEMA$);
if (isValidValue(fields()[0], other.year)) {
this.year = data().deepCopy(fields()[0].schema(), other.year);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.registration)) {
this.registration = data().deepCopy(fields()[1].schema(), other.registration);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.make)) {
this.make = data().deepCopy(fields()[2].schema(), other.make);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.model)) {
this.model = data().deepCopy(fields()[3].schema(), other.model);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.vin)) {
this.vin = data().deepCopy(fields()[4].schema(), other.vin);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.doors)) {
this.doors = data().deepCopy(fields()[5].schema(), other.doors);
fieldSetFlags()[5] = true;
}
if (isValidValue(fields()[6], other.engine)) {
this.engine = data().deepCopy(fields()[6].schema(), other.engine);
fieldSetFlags()[6] = true;
}
if (isValidValue(fields()[7], other.optionalExtra)) {
this.optionalExtra = data().deepCopy(fields()[7].schema(), other.optionalExtra);
fieldSetFlags()[7] = true;
}
if (isValidValue(fields()[8], other.serviceHistory)) {
this.serviceHistory = data().deepCopy(fields()[8].schema(), other.serviceHistory);
fieldSetFlags()[8] = true;
}
}
/** Gets the value of the 'year' field */
public java.lang.Long getYear() {
return year;
}
/** Sets the value of the 'year' field */
public parquet.avro.Car.Builder setYear(long value) {
validate(fields()[0], value);
this.year = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'year' field has been set */
public boolean hasYear() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'year' field */
public parquet.avro.Car.Builder clearYear() {
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'registration' field */
public java.lang.String getRegistration() {
return registration;
}
/** Sets the value of the 'registration' field */
public parquet.avro.Car.Builder setRegistration(java.lang.String value) {
validate(fields()[1], value);
this.registration = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'registration' field has been set */
public boolean hasRegistration() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'registration' field */
public parquet.avro.Car.Builder clearRegistration() {
registration = null;
fieldSetFlags()[1] = false;
return this;
}
/** Gets the value of the 'make' field */
public java.lang.String getMake() {
return make;
}
/** Sets the value of the 'make' field */
public parquet.avro.Car.Builder setMake(java.lang.String value) {
validate(fields()[2], value);
this.make = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'make' field has been set */
public boolean hasMake() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'make' field */
public parquet.avro.Car.Builder clearMake() {
make = null;
fieldSetFlags()[2] = false;
return this;
}
/** Gets the value of the 'model' field */
public java.lang.String getModel() {
return model;
}
/** Sets the value of the 'model' field */
public parquet.avro.Car.Builder setModel(java.lang.String value) {
validate(fields()[3], value);
this.model = value;
fieldSetFlags()[3] = true;
return this;
}
/** Checks whether the 'model' field has been set */
public boolean hasModel() {
return fieldSetFlags()[3];
}
/** Clears the value of the 'model' field */
public parquet.avro.Car.Builder clearModel() {
model = null;
fieldSetFlags()[3] = false;
return this;
}
/** Gets the value of the 'vin' field */
public parquet.avro.Vin getVin() {
return vin;
}
/** Sets the value of the 'vin' field */
public parquet.avro.Car.Builder setVin(parquet.avro.Vin value) {
validate(fields()[4], value);
this.vin = value;
fieldSetFlags()[4] = true;
return this;
}
/** Checks whether the 'vin' field has been set */
public boolean hasVin() {
return fieldSetFlags()[4];
}
/** Clears the value of the 'vin' field */
public parquet.avro.Car.Builder clearVin() {
vin = null;
fieldSetFlags()[4] = false;
return this;
}
/** Gets the value of the 'doors' field */
public java.lang.Integer getDoors() {
return doors;
}
/** Sets the value of the 'doors' field */
public parquet.avro.Car.Builder setDoors(int value) {
validate(fields()[5], value);
this.doors = value;
fieldSetFlags()[5] = true;
return this;
}
/** Checks whether the 'doors' field has been set */
public boolean hasDoors() {
return fieldSetFlags()[5];
}
/** Clears the value of the 'doors' field */
public parquet.avro.Car.Builder clearDoors() {
fieldSetFlags()[5] = false;
return this;
}
/** Gets the value of the 'engine' field */
public parquet.avro.Engine getEngine() {
return engine;
}
/** Sets the value of the 'engine' field */
public parquet.avro.Car.Builder setEngine(parquet.avro.Engine value) {
validate(fields()[6], value);
this.engine = value;
fieldSetFlags()[6] = true;
return this;
}
/** Checks whether the 'engine' field has been set */
public boolean hasEngine() {
return fieldSetFlags()[6];
}
/** Clears the value of the 'engine' field */
public parquet.avro.Car.Builder clearEngine() {
engine = null;
fieldSetFlags()[6] = false;
return this;
}
/** Gets the value of the 'optionalExtra' field */
public java.lang.Object getOptionalExtra() {
return optionalExtra;
}
/** Sets the value of the 'optionalExtra' field */
public parquet.avro.Car.Builder setOptionalExtra(java.lang.Object value) {
validate(fields()[7], value);
this.optionalExtra = value;
fieldSetFlags()[7] = true;
return this;
}
/** Checks whether the 'optionalExtra' field has been set */
public boolean hasOptionalExtra() {
return fieldSetFlags()[7];
}
/** Clears the value of the 'optionalExtra' field */
public parquet.avro.Car.Builder clearOptionalExtra() {
optionalExtra = null;
fieldSetFlags()[7] = false;
return this;
}
/** Gets the value of the 'serviceHistory' field */
public java.util.List getServiceHistory() {
return serviceHistory;
}
/** Sets the value of the 'serviceHistory' field */
public parquet.avro.Car.Builder setServiceHistory(java.util.List value) {
validate(fields()[8], value);
this.serviceHistory = value;
fieldSetFlags()[8] = true;
return this;
}
/** Checks whether the 'serviceHistory' field has been set */
public boolean hasServiceHistory() {
return fieldSetFlags()[8];
}
/** Clears the value of the 'serviceHistory' field */
public parquet.avro.Car.Builder clearServiceHistory() {
serviceHistory = null;
fieldSetFlags()[8] = false;
return this;
}
@Override
public Car build() {
try {
Car record = new Car();
record.year = fieldSetFlags()[0] ? this.year : (java.lang.Long) defaultValue(fields()[0]);
record.registration = fieldSetFlags()[1] ? this.registration : (java.lang.String) defaultValue(fields()[1]);
record.make = fieldSetFlags()[2] ? this.make : (java.lang.String) defaultValue(fields()[2]);
record.model = fieldSetFlags()[3] ? this.model : (java.lang.String) defaultValue(fields()[3]);
record.vin = fieldSetFlags()[4] ? this.vin : (parquet.avro.Vin) defaultValue(fields()[4]);
record.doors = fieldSetFlags()[5] ? this.doors : (java.lang.Integer) defaultValue(fields()[5]);
record.engine = fieldSetFlags()[6] ? this.engine : (parquet.avro.Engine) defaultValue(fields()[6]);
record.optionalExtra = fieldSetFlags()[7] ? this.optionalExtra : (java.lang.Object) defaultValue(fields()[7]);
record.serviceHistory = fieldSetFlags()[8] ? this.serviceHistory : (java.util.List) defaultValue(fields()[8]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy