
sunnylabs.report.IndexUpdate Maven / Gradle / Ivy
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package sunnylabs.report;
@SuppressWarnings("all")
public class IndexUpdate 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\":\"IndexUpdate\",\"namespace\":\"sunnylabs.report\",\"fields\":[{\"name\":\"table\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"metricKey\",\"type\":\"bytes\"},{\"name\":\"hostKey\",\"type\":\"bytes\"},{\"name\":\"tagIds\",\"type\":{\"type\":\"array\",\"items\":\"bytes\"}},{\"name\":\"timestamp\",\"type\":\"long\"}]}");
private java.lang.String table;
private java.nio.ByteBuffer metricKey;
private java.nio.ByteBuffer hostKey;
private java.util.List tagIds;
private long timestamp;
/**
* Default constructor.
*/
public IndexUpdate() {}
/**
* All-args constructor.
*/
public IndexUpdate(java.lang.String table, java.nio.ByteBuffer metricKey, java.nio.ByteBuffer hostKey, java.util.List tagIds, java.lang.Long timestamp) {
this.table = table;
this.metricKey = metricKey;
this.hostKey = hostKey;
this.tagIds = tagIds;
this.timestamp = timestamp;
}
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 table;
case 1: return metricKey;
case 2: return hostKey;
case 3: return tagIds;
case 4: return timestamp;
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: table = (java.lang.String)value$; break;
case 1: metricKey = (java.nio.ByteBuffer)value$; break;
case 2: hostKey = (java.nio.ByteBuffer)value$; break;
case 3: tagIds = (java.util.List)value$; break;
case 4: timestamp = (java.lang.Long)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'table' field.
*/
public java.lang.String getTable() {
return table;
}
/**
* Sets the value of the 'table' field.
* @param value the value to set.
*/
public void setTable(java.lang.String value) {
this.table = value;
}
/**
* Gets the value of the 'metricKey' field.
*/
public java.nio.ByteBuffer getMetricKey() {
return metricKey;
}
/**
* Sets the value of the 'metricKey' field.
* @param value the value to set.
*/
public void setMetricKey(java.nio.ByteBuffer value) {
this.metricKey = value;
}
/**
* Gets the value of the 'hostKey' field.
*/
public java.nio.ByteBuffer getHostKey() {
return hostKey;
}
/**
* Sets the value of the 'hostKey' field.
* @param value the value to set.
*/
public void setHostKey(java.nio.ByteBuffer value) {
this.hostKey = value;
}
/**
* Gets the value of the 'tagIds' field.
*/
public java.util.List getTagIds() {
return tagIds;
}
/**
* Sets the value of the 'tagIds' field.
* @param value the value to set.
*/
public void setTagIds(java.util.List value) {
this.tagIds = value;
}
/**
* Gets the value of the 'timestamp' field.
*/
public java.lang.Long getTimestamp() {
return timestamp;
}
/**
* Sets the value of the 'timestamp' field.
* @param value the value to set.
*/
public void setTimestamp(java.lang.Long value) {
this.timestamp = value;
}
/** Creates a new IndexUpdate RecordBuilder */
public static sunnylabs.report.IndexUpdate.Builder newBuilder() {
return new sunnylabs.report.IndexUpdate.Builder();
}
/** Creates a new IndexUpdate RecordBuilder by copying an existing Builder */
public static sunnylabs.report.IndexUpdate.Builder newBuilder(sunnylabs.report.IndexUpdate.Builder other) {
return new sunnylabs.report.IndexUpdate.Builder(other);
}
/** Creates a new IndexUpdate RecordBuilder by copying an existing IndexUpdate instance */
public static sunnylabs.report.IndexUpdate.Builder newBuilder(sunnylabs.report.IndexUpdate other) {
return new sunnylabs.report.IndexUpdate.Builder(other);
}
/**
* RecordBuilder for IndexUpdate instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private java.lang.String table;
private java.nio.ByteBuffer metricKey;
private java.nio.ByteBuffer hostKey;
private java.util.List tagIds;
private long timestamp;
/** Creates a new Builder */
private Builder() {
super(sunnylabs.report.IndexUpdate.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(sunnylabs.report.IndexUpdate.Builder other) {
super(other);
}
/** Creates a Builder by copying an existing IndexUpdate instance */
private Builder(sunnylabs.report.IndexUpdate other) {
super(sunnylabs.report.IndexUpdate.SCHEMA$);
if (isValidValue(fields()[0], other.table)) {
this.table = (java.lang.String) data().deepCopy(fields()[0].schema(), other.table);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.metricKey)) {
this.metricKey = (java.nio.ByteBuffer) data().deepCopy(fields()[1].schema(), other.metricKey);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.hostKey)) {
this.hostKey = (java.nio.ByteBuffer) data().deepCopy(fields()[2].schema(), other.hostKey);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.tagIds)) {
this.tagIds = (java.util.List) data().deepCopy(fields()[3].schema(), other.tagIds);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.timestamp)) {
this.timestamp = (java.lang.Long) data().deepCopy(fields()[4].schema(), other.timestamp);
fieldSetFlags()[4] = true;
}
}
/** Gets the value of the 'table' field */
public java.lang.String getTable() {
return table;
}
/** Sets the value of the 'table' field */
public sunnylabs.report.IndexUpdate.Builder setTable(java.lang.String value) {
validate(fields()[0], value);
this.table = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'table' field has been set */
public boolean hasTable() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'table' field */
public sunnylabs.report.IndexUpdate.Builder clearTable() {
table = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'metricKey' field */
public java.nio.ByteBuffer getMetricKey() {
return metricKey;
}
/** Sets the value of the 'metricKey' field */
public sunnylabs.report.IndexUpdate.Builder setMetricKey(java.nio.ByteBuffer value) {
validate(fields()[1], value);
this.metricKey = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'metricKey' field has been set */
public boolean hasMetricKey() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'metricKey' field */
public sunnylabs.report.IndexUpdate.Builder clearMetricKey() {
metricKey = null;
fieldSetFlags()[1] = false;
return this;
}
/** Gets the value of the 'hostKey' field */
public java.nio.ByteBuffer getHostKey() {
return hostKey;
}
/** Sets the value of the 'hostKey' field */
public sunnylabs.report.IndexUpdate.Builder setHostKey(java.nio.ByteBuffer value) {
validate(fields()[2], value);
this.hostKey = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'hostKey' field has been set */
public boolean hasHostKey() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'hostKey' field */
public sunnylabs.report.IndexUpdate.Builder clearHostKey() {
hostKey = null;
fieldSetFlags()[2] = false;
return this;
}
/** Gets the value of the 'tagIds' field */
public java.util.List getTagIds() {
return tagIds;
}
/** Sets the value of the 'tagIds' field */
public sunnylabs.report.IndexUpdate.Builder setTagIds(java.util.List value) {
validate(fields()[3], value);
this.tagIds = value;
fieldSetFlags()[3] = true;
return this;
}
/** Checks whether the 'tagIds' field has been set */
public boolean hasTagIds() {
return fieldSetFlags()[3];
}
/** Clears the value of the 'tagIds' field */
public sunnylabs.report.IndexUpdate.Builder clearTagIds() {
tagIds = null;
fieldSetFlags()[3] = false;
return this;
}
/** Gets the value of the 'timestamp' field */
public java.lang.Long getTimestamp() {
return timestamp;
}
/** Sets the value of the 'timestamp' field */
public sunnylabs.report.IndexUpdate.Builder setTimestamp(long value) {
validate(fields()[4], value);
this.timestamp = value;
fieldSetFlags()[4] = true;
return this;
}
/** Checks whether the 'timestamp' field has been set */
public boolean hasTimestamp() {
return fieldSetFlags()[4];
}
/** Clears the value of the 'timestamp' field */
public sunnylabs.report.IndexUpdate.Builder clearTimestamp() {
fieldSetFlags()[4] = false;
return this;
}
@Override
public IndexUpdate build() {
try {
IndexUpdate record = new IndexUpdate();
record.table = fieldSetFlags()[0] ? this.table : (java.lang.String) defaultValue(fields()[0]);
record.metricKey = fieldSetFlags()[1] ? this.metricKey : (java.nio.ByteBuffer) defaultValue(fields()[1]);
record.hostKey = fieldSetFlags()[2] ? this.hostKey : (java.nio.ByteBuffer) defaultValue(fields()[2]);
record.tagIds = fieldSetFlags()[3] ? this.tagIds : (java.util.List) defaultValue(fields()[3]);
record.timestamp = fieldSetFlags()[4] ? this.timestamp : (java.lang.Long) defaultValue(fields()[4]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy