Skip to content

Instantly share code, notes, and snippets.

@bvdeenen
Created June 22, 2017 08:38
Show Gist options
  • Save bvdeenen/590ed8e07c3feb825aa73084a83b1480 to your computer and use it in GitHub Desktop.
Save bvdeenen/590ed8e07c3feb825aa73084a83b1480 to your computer and use it in GitHub Desktop.
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package com.kpn.datalab.schemas.omnicrm.contact_history.v1;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class contactHistory 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\":\"contactHistory\",\"namespace\":\"com.kpn.datalab.schemas.omnicrm.contact_history.v1\",\"fields\":[{\"name\":\"events\",\"type\":{\"type\":\"array\",\"items\":\"bytes\"}},{\"name\":\"krn\",\"type\":\"string\"}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
@Deprecated public java.util.List<java.nio.ByteBuffer> events;
@Deprecated public java.lang.CharSequence krn;
/**
* Default constructor. Note that this does not initialize fields
* to their default values from the schema. If that is desired then
* one should use <code>newBuilder()</code>.
*/
public contactHistory() {}
/**
* All-args constructor.
*/
public contactHistory(java.util.List<java.nio.ByteBuffer> events, java.lang.CharSequence krn) {
this.events = events;
this.krn = krn;
}
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 events;
case 1: return krn;
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: events = (java.util.List<java.nio.ByteBuffer>)value$; break;
case 1: krn = (java.lang.CharSequence)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'events' field.
*/
public java.util.List<java.nio.ByteBuffer> getEvents() {
return events;
}
/**
* Sets the value of the 'events' field.
* @param value the value to set.
*/
public void setEvents(java.util.List<java.nio.ByteBuffer> value) {
this.events = value;
}
/**
* Gets the value of the 'krn' field.
*/
public java.lang.CharSequence getKrn() {
return krn;
}
/**
* Sets the value of the 'krn' field.
* @param value the value to set.
*/
public void setKrn(java.lang.CharSequence value) {
this.krn = value;
}
/** Creates a new contactHistory RecordBuilder */
public static com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory.Builder newBuilder() {
return new com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory.Builder();
}
/** Creates a new contactHistory RecordBuilder by copying an existing Builder */
public static com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory.Builder newBuilder(com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory.Builder other) {
return new com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory.Builder(other);
}
/** Creates a new contactHistory RecordBuilder by copying an existing contactHistory instance */
public static com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory.Builder newBuilder(com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory other) {
return new com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory.Builder(other);
}
/**
* RecordBuilder for contactHistory instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<contactHistory>
implements org.apache.avro.data.RecordBuilder<contactHistory> {
private java.util.List<java.nio.ByteBuffer> events;
private java.lang.CharSequence krn;
/** Creates a new Builder */
private Builder() {
super(com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory.Builder other) {
super(other);
if (isValidValue(fields()[0], other.events)) {
this.events = data().deepCopy(fields()[0].schema(), other.events);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.krn)) {
this.krn = data().deepCopy(fields()[1].schema(), other.krn);
fieldSetFlags()[1] = true;
}
}
/** Creates a Builder by copying an existing contactHistory instance */
private Builder(com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory other) {
super(com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory.SCHEMA$);
if (isValidValue(fields()[0], other.events)) {
this.events = data().deepCopy(fields()[0].schema(), other.events);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.krn)) {
this.krn = data().deepCopy(fields()[1].schema(), other.krn);
fieldSetFlags()[1] = true;
}
}
/** Gets the value of the 'events' field */
public java.util.List<java.nio.ByteBuffer> getEvents() {
return events;
}
/** Sets the value of the 'events' field */
public com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory.Builder setEvents(java.util.List<java.nio.ByteBuffer> value) {
validate(fields()[0], value);
this.events = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'events' field has been set */
public boolean hasEvents() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'events' field */
public com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory.Builder clearEvents() {
events = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'krn' field */
public java.lang.CharSequence getKrn() {
return krn;
}
/** Sets the value of the 'krn' field */
public com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory.Builder setKrn(java.lang.CharSequence value) {
validate(fields()[1], value);
this.krn = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'krn' field has been set */
public boolean hasKrn() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'krn' field */
public com.kpn.datalab.schemas.omnicrm.contact_history.v1.contactHistory.Builder clearKrn() {
krn = null;
fieldSetFlags()[1] = false;
return this;
}
@Override
public contactHistory build() {
try {
contactHistory record = new contactHistory();
record.events = fieldSetFlags()[0] ? this.events : (java.util.List<java.nio.ByteBuffer>) defaultValue(fields()[0]);
record.krn = fieldSetFlags()[1] ? this.krn : (java.lang.CharSequence) defaultValue(fields()[1]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment