Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.apache.parquet.avro;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class NewCar 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\":\"NewCar\",\"namespace\":\"org.apache.parquet.avro\",\"fields\":[{\"name\":\"year\",\"type\":\"long\"},{\"name\":\"registration\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"brand\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"aliases\":[\"make\"]},{\"name\":\"model\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"vin\",\"type\":{\"type\":\"fixed\",\"name\":\"Vin\",\"size\":17}},{\"name\":\"doors\",\"type\":\"long\"},{\"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},{\"name\":\"opt\",\"type\":\"int\",\"default\":5},{\"name\":\"description\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
@Deprecated public long year;
@Deprecated public java.lang.String registration;
@Deprecated public java.lang.String brand;
@Deprecated public java.lang.String model;
@Deprecated public org.apache.parquet.avro.Vin vin;
@Deprecated public long doors;
@Deprecated public org.apache.parquet.avro.Engine engine;
@Deprecated public java.lang.Object optionalExtra;
@Deprecated public java.util.List serviceHistory;
@Deprecated public int opt;
@Deprecated public java.lang.String description;
/**
* 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 NewCar() {}
/**
* All-args constructor.
*/
public NewCar(java.lang.Long year, java.lang.String registration, java.lang.String brand, java.lang.String model, org.apache.parquet.avro.Vin vin, java.lang.Long doors, org.apache.parquet.avro.Engine engine, java.lang.Object optionalExtra, java.util.List serviceHistory, java.lang.Integer opt, java.lang.String description) {
this.year = year;
this.registration = registration;
this.brand = brand;
this.model = model;
this.vin = vin;
this.doors = doors;
this.engine = engine;
this.optionalExtra = optionalExtra;
this.serviceHistory = serviceHistory;
this.opt = opt;
this.description = description;
}
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 brand;
case 3: return model;
case 4: return vin;
case 5: return doors;
case 6: return engine;
case 7: return optionalExtra;
case 8: return serviceHistory;
case 9: return opt;
case 10: return description;
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: brand = (java.lang.String)value$; break;
case 3: model = (java.lang.String)value$; break;
case 4: vin = (org.apache.parquet.avro.Vin)value$; break;
case 5: doors = (java.lang.Long)value$; break;
case 6: engine = (org.apache.parquet.avro.Engine)value$; break;
case 7: optionalExtra = (java.lang.Object)value$; break;
case 8: serviceHistory = (java.util.List)value$; break;
case 9: opt = (java.lang.Integer)value$; break;
case 10: description = (java.lang.String)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 'brand' field.
*/
public java.lang.String getBrand() {
return brand;
}
/**
* Sets the value of the 'brand' field.
* @param value the value to set.
*/
public void setBrand(java.lang.String value) {
this.brand = 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 org.apache.parquet.avro.Vin getVin() {
return vin;
}
/**
* Sets the value of the 'vin' field.
* @param value the value to set.
*/
public void setVin(org.apache.parquet.avro.Vin value) {
this.vin = value;
}
/**
* Gets the value of the 'doors' field.
*/
public java.lang.Long getDoors() {
return doors;
}
/**
* Sets the value of the 'doors' field.
* @param value the value to set.
*/
public void setDoors(java.lang.Long value) {
this.doors = value;
}
/**
* Gets the value of the 'engine' field.
*/
public org.apache.parquet.avro.Engine getEngine() {
return engine;
}
/**
* Sets the value of the 'engine' field.
* @param value the value to set.
*/
public void setEngine(org.apache.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;
}
/**
* Gets the value of the 'opt' field.
*/
public java.lang.Integer getOpt() {
return opt;
}
/**
* Sets the value of the 'opt' field.
* @param value the value to set.
*/
public void setOpt(java.lang.Integer value) {
this.opt = value;
}
/**
* Gets the value of the 'description' field.
*/
public java.lang.String getDescription() {
return description;
}
/**
* Sets the value of the 'description' field.
* @param value the value to set.
*/
public void setDescription(java.lang.String value) {
this.description = value;
}
/** Creates a new NewCar RecordBuilder */
public static org.apache.parquet.avro.NewCar.Builder newBuilder() {
return new org.apache.parquet.avro.NewCar.Builder();
}
/** Creates a new NewCar RecordBuilder by copying an existing Builder */
public static org.apache.parquet.avro.NewCar.Builder newBuilder(org.apache.parquet.avro.NewCar.Builder other) {
return new org.apache.parquet.avro.NewCar.Builder(other);
}
/** Creates a new NewCar RecordBuilder by copying an existing NewCar instance */
public static org.apache.parquet.avro.NewCar.Builder newBuilder(org.apache.parquet.avro.NewCar other) {
return new org.apache.parquet.avro.NewCar.Builder(other);
}
/**
* RecordBuilder for NewCar 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 brand;
private java.lang.String model;
private org.apache.parquet.avro.Vin vin;
private long doors;
private org.apache.parquet.avro.Engine engine;
private java.lang.Object optionalExtra;
private java.util.List serviceHistory;
private int opt;
private java.lang.String description;
/** Creates a new Builder */
private Builder() {
super(org.apache.parquet.avro.NewCar.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.apache.parquet.avro.NewCar.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.brand)) {
this.brand = data().deepCopy(fields()[2].schema(), other.brand);
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;
}
if (isValidValue(fields()[9], other.opt)) {
this.opt = data().deepCopy(fields()[9].schema(), other.opt);
fieldSetFlags()[9] = true;
}
if (isValidValue(fields()[10], other.description)) {
this.description = data().deepCopy(fields()[10].schema(), other.description);
fieldSetFlags()[10] = true;
}
}
/** Creates a Builder by copying an existing NewCar instance */
private Builder(org.apache.parquet.avro.NewCar other) {
super(org.apache.parquet.avro.NewCar.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.brand)) {
this.brand = data().deepCopy(fields()[2].schema(), other.brand);
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;
}
if (isValidValue(fields()[9], other.opt)) {
this.opt = data().deepCopy(fields()[9].schema(), other.opt);
fieldSetFlags()[9] = true;
}
if (isValidValue(fields()[10], other.description)) {
this.description = data().deepCopy(fields()[10].schema(), other.description);
fieldSetFlags()[10] = true;
}
}
/** Gets the value of the 'year' field */
public java.lang.Long getYear() {
return year;
}
/** Sets the value of the 'year' field */
public org.apache.parquet.avro.NewCar.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 org.apache.parquet.avro.NewCar.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 org.apache.parquet.avro.NewCar.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 org.apache.parquet.avro.NewCar.Builder clearRegistration() {
registration = null;
fieldSetFlags()[1] = false;
return this;
}
/** Gets the value of the 'brand' field */
public java.lang.String getBrand() {
return brand;
}
/** Sets the value of the 'brand' field */
public org.apache.parquet.avro.NewCar.Builder setBrand(java.lang.String value) {
validate(fields()[2], value);
this.brand = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'brand' field has been set */
public boolean hasBrand() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'brand' field */
public org.apache.parquet.avro.NewCar.Builder clearBrand() {
brand = 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 org.apache.parquet.avro.NewCar.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 org.apache.parquet.avro.NewCar.Builder clearModel() {
model = null;
fieldSetFlags()[3] = false;
return this;
}
/** Gets the value of the 'vin' field */
public org.apache.parquet.avro.Vin getVin() {
return vin;
}
/** Sets the value of the 'vin' field */
public org.apache.parquet.avro.NewCar.Builder setVin(org.apache.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 org.apache.parquet.avro.NewCar.Builder clearVin() {
vin = null;
fieldSetFlags()[4] = false;
return this;
}
/** Gets the value of the 'doors' field */
public java.lang.Long getDoors() {
return doors;
}
/** Sets the value of the 'doors' field */
public org.apache.parquet.avro.NewCar.Builder setDoors(long 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 org.apache.parquet.avro.NewCar.Builder clearDoors() {
fieldSetFlags()[5] = false;
return this;
}
/** Gets the value of the 'engine' field */
public org.apache.parquet.avro.Engine getEngine() {
return engine;
}
/** Sets the value of the 'engine' field */
public org.apache.parquet.avro.NewCar.Builder setEngine(org.apache.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 org.apache.parquet.avro.NewCar.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 org.apache.parquet.avro.NewCar.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 org.apache.parquet.avro.NewCar.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 org.apache.parquet.avro.NewCar.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 org.apache.parquet.avro.NewCar.Builder clearServiceHistory() {
serviceHistory = null;
fieldSetFlags()[8] = false;
return this;
}
/** Gets the value of the 'opt' field */
public java.lang.Integer getOpt() {
return opt;
}
/** Sets the value of the 'opt' field */
public org.apache.parquet.avro.NewCar.Builder setOpt(int value) {
validate(fields()[9], value);
this.opt = value;
fieldSetFlags()[9] = true;
return this;
}
/** Checks whether the 'opt' field has been set */
public boolean hasOpt() {
return fieldSetFlags()[9];
}
/** Clears the value of the 'opt' field */
public org.apache.parquet.avro.NewCar.Builder clearOpt() {
fieldSetFlags()[9] = false;
return this;
}
/** Gets the value of the 'description' field */
public java.lang.String getDescription() {
return description;
}
/** Sets the value of the 'description' field */
public org.apache.parquet.avro.NewCar.Builder setDescription(java.lang.String value) {
validate(fields()[10], value);
this.description = value;
fieldSetFlags()[10] = true;
return this;
}
/** Checks whether the 'description' field has been set */
public boolean hasDescription() {
return fieldSetFlags()[10];
}
/** Clears the value of the 'description' field */
public org.apache.parquet.avro.NewCar.Builder clearDescription() {
description = null;
fieldSetFlags()[10] = false;
return this;
}
@Override
public NewCar build() {
try {
NewCar record = new NewCar();
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.brand = fieldSetFlags()[2] ? this.brand : (java.lang.String) defaultValue(fields()[2]);
record.model = fieldSetFlags()[3] ? this.model : (java.lang.String) defaultValue(fields()[3]);
record.vin = fieldSetFlags()[4] ? this.vin : (org.apache.parquet.avro.Vin) defaultValue(fields()[4]);
record.doors = fieldSetFlags()[5] ? this.doors : (java.lang.Long) defaultValue(fields()[5]);
record.engine = fieldSetFlags()[6] ? this.engine : (org.apache.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]);
record.opt = fieldSetFlags()[9] ? this.opt : (java.lang.Integer) defaultValue(fields()[9]);
record.description = fieldSetFlags()[10] ? this.description : (java.lang.String) defaultValue(fields()[10]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}