/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package gobblin.metrics; import org.apache.avro.specific.SpecificData; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class FlatGobblinMetric extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { private static final long serialVersionUID = 277556715077932861L; public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"FlatGobblinMetric\",\"namespace\":\"gobblin.metrics\",\"fields\":[{\"name\":\"tags\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},\"doc\":\"Tags associated with the metrics in the form key:value.\"},{\"name\":\"timestamp\",\"type\":\"long\",\"doc\":\"Time at which metrics were reported.\"},{\"name\":\"metricName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"The name of this metric.\"},{\"name\":\"metricValue\",\"type\":\"double\",\"doc\":\"The value of this metric.\"}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } /** Tags associated with the metrics in the form key:value. */ @Deprecated public java.util.List<java.lang.String> tags; /** Time at which metrics were reported. */ @Deprecated public long timestamp; /** The name of this metric. */ @Deprecated public java.lang.String metricName; /** The value of this metric. */ @Deprecated public double metricValue; /** * 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 FlatGobblinMetric() {} /** * All-args constructor. * @param tags Tags associated with the metrics in the form key:value. * @param timestamp Time at which metrics were reported. * @param metricName The name of this metric. * @param metricValue The value of this metric. */ public FlatGobblinMetric(java.util.List<java.lang.String> tags, java.lang.Long timestamp, java.lang.String metricName, java.lang.Double metricValue) { this.tags = tags; this.timestamp = timestamp; this.metricName = metricName; this.metricValue = metricValue; } 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 tags; case 1: return timestamp; case 2: return metricName; case 3: return metricValue; 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: tags = (java.util.List<java.lang.String>)value$; break; case 1: timestamp = (java.lang.Long)value$; break; case 2: metricName = (java.lang.String)value$; break; case 3: metricValue = (java.lang.Double)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'tags' field. * @return Tags associated with the metrics in the form key:value. */ public java.util.List<java.lang.String> getTags() { return tags; } /** * Sets the value of the 'tags' field. * Tags associated with the metrics in the form key:value. * @param value the value to set. */ public void setTags(java.util.List<java.lang.String> value) { this.tags = value; } /** * Gets the value of the 'timestamp' field. * @return Time at which metrics were reported. */ public java.lang.Long getTimestamp() { return timestamp; } /** * Sets the value of the 'timestamp' field. * Time at which metrics were reported. * @param value the value to set. */ public void setTimestamp(java.lang.Long value) { this.timestamp = value; } /** * Gets the value of the 'metricName' field. * @return The name of this metric. */ public java.lang.String getMetricName() { return metricName; } /** * Sets the value of the 'metricName' field. * The name of this metric. * @param value the value to set. */ public void setMetricName(java.lang.String value) { this.metricName = value; } /** * Gets the value of the 'metricValue' field. * @return The value of this metric. */ public java.lang.Double getMetricValue() { return metricValue; } /** * Sets the value of the 'metricValue' field. * The value of this metric. * @param value the value to set. */ public void setMetricValue(java.lang.Double value) { this.metricValue = value; } /** * Creates a new FlatGobblinMetric RecordBuilder. * @return A new FlatGobblinMetric RecordBuilder */ public static gobblin.metrics.FlatGobblinMetric.Builder newBuilder() { return new gobblin.metrics.FlatGobblinMetric.Builder(); } /** * Creates a new FlatGobblinMetric RecordBuilder by copying an existing Builder. * @param other The existing builder to copy. * @return A new FlatGobblinMetric RecordBuilder */ public static gobblin.metrics.FlatGobblinMetric.Builder newBuilder(gobblin.metrics.FlatGobblinMetric.Builder other) { return new gobblin.metrics.FlatGobblinMetric.Builder(other); } /** * Creates a new FlatGobblinMetric RecordBuilder by copying an existing FlatGobblinMetric instance. * @param other The existing instance to copy. * @return A new FlatGobblinMetric RecordBuilder */ public static gobblin.metrics.FlatGobblinMetric.Builder newBuilder(gobblin.metrics.FlatGobblinMetric other) { return new gobblin.metrics.FlatGobblinMetric.Builder(other); } /** * RecordBuilder for FlatGobblinMetric instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<FlatGobblinMetric> implements org.apache.avro.data.RecordBuilder<FlatGobblinMetric> { /** Tags associated with the metrics in the form key:value. */ private java.util.List<java.lang.String> tags; /** Time at which metrics were reported. */ private long timestamp; /** The name of this metric. */ private java.lang.String metricName; /** The value of this metric. */ private double metricValue; /** Creates a new Builder */ private Builder() { super(SCHEMA$); } /** * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ private Builder(gobblin.metrics.FlatGobblinMetric.Builder other) { super(other); if (isValidValue(fields()[0], other.tags)) { this.tags = data().deepCopy(fields()[0].schema(), other.tags); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.timestamp)) { this.timestamp = data().deepCopy(fields()[1].schema(), other.timestamp); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.metricName)) { this.metricName = data().deepCopy(fields()[2].schema(), other.metricName); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.metricValue)) { this.metricValue = data().deepCopy(fields()[3].schema(), other.metricValue); fieldSetFlags()[3] = true; } } /** * Creates a Builder by copying an existing FlatGobblinMetric instance * @param other The existing instance to copy. */ private Builder(gobblin.metrics.FlatGobblinMetric other) { super(SCHEMA$); if (isValidValue(fields()[0], other.tags)) { this.tags = data().deepCopy(fields()[0].schema(), other.tags); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.timestamp)) { this.timestamp = data().deepCopy(fields()[1].schema(), other.timestamp); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.metricName)) { this.metricName = data().deepCopy(fields()[2].schema(), other.metricName); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.metricValue)) { this.metricValue = data().deepCopy(fields()[3].schema(), other.metricValue); fieldSetFlags()[3] = true; } } /** * Gets the value of the 'tags' field. * Tags associated with the metrics in the form key:value. * @return The value. */ public java.util.List<java.lang.String> getTags() { return tags; } /** * Sets the value of the 'tags' field. * Tags associated with the metrics in the form key:value. * @param value The value of 'tags'. * @return This builder. */ public gobblin.metrics.FlatGobblinMetric.Builder setTags(java.util.List<java.lang.String> value) { validate(fields()[0], value); this.tags = value; fieldSetFlags()[0] = true; return this; } /** * Checks whether the 'tags' field has been set. * Tags associated with the metrics in the form key:value. * @return True if the 'tags' field has been set, false otherwise. */ public boolean hasTags() { return fieldSetFlags()[0]; } /** * Clears the value of the 'tags' field. * Tags associated with the metrics in the form key:value. * @return This builder. */ public gobblin.metrics.FlatGobblinMetric.Builder clearTags() { tags = null; fieldSetFlags()[0] = false; return this; } /** * Gets the value of the 'timestamp' field. * Time at which metrics were reported. * @return The value. */ public java.lang.Long getTimestamp() { return timestamp; } /** * Sets the value of the 'timestamp' field. * Time at which metrics were reported. * @param value The value of 'timestamp'. * @return This builder. */ public gobblin.metrics.FlatGobblinMetric.Builder setTimestamp(long value) { validate(fields()[1], value); this.timestamp = value; fieldSetFlags()[1] = true; return this; } /** * Checks whether the 'timestamp' field has been set. * Time at which metrics were reported. * @return True if the 'timestamp' field has been set, false otherwise. */ public boolean hasTimestamp() { return fieldSetFlags()[1]; } /** * Clears the value of the 'timestamp' field. * Time at which metrics were reported. * @return This builder. */ public gobblin.metrics.FlatGobblinMetric.Builder clearTimestamp() { fieldSetFlags()[1] = false; return this; } /** * Gets the value of the 'metricName' field. * The name of this metric. * @return The value. */ public java.lang.String getMetricName() { return metricName; } /** * Sets the value of the 'metricName' field. * The name of this metric. * @param value The value of 'metricName'. * @return This builder. */ public gobblin.metrics.FlatGobblinMetric.Builder setMetricName(java.lang.String value) { validate(fields()[2], value); this.metricName = value; fieldSetFlags()[2] = true; return this; } /** * Checks whether the 'metricName' field has been set. * The name of this metric. * @return True if the 'metricName' field has been set, false otherwise. */ public boolean hasMetricName() { return fieldSetFlags()[2]; } /** * Clears the value of the 'metricName' field. * The name of this metric. * @return This builder. */ public gobblin.metrics.FlatGobblinMetric.Builder clearMetricName() { metricName = null; fieldSetFlags()[2] = false; return this; } /** * Gets the value of the 'metricValue' field. * The value of this metric. * @return The value. */ public java.lang.Double getMetricValue() { return metricValue; } /** * Sets the value of the 'metricValue' field. * The value of this metric. * @param value The value of 'metricValue'. * @return This builder. */ public gobblin.metrics.FlatGobblinMetric.Builder setMetricValue(double value) { validate(fields()[3], value); this.metricValue = value; fieldSetFlags()[3] = true; return this; } /** * Checks whether the 'metricValue' field has been set. * The value of this metric. * @return True if the 'metricValue' field has been set, false otherwise. */ public boolean hasMetricValue() { return fieldSetFlags()[3]; } /** * Clears the value of the 'metricValue' field. * The value of this metric. * @return This builder. */ public gobblin.metrics.FlatGobblinMetric.Builder clearMetricValue() { fieldSetFlags()[3] = false; return this; } @Override public FlatGobblinMetric build() { try { FlatGobblinMetric record = new FlatGobblinMetric(); record.tags = fieldSetFlags()[0] ? this.tags : (java.util.List<java.lang.String>) defaultValue(fields()[0]); record.timestamp = fieldSetFlags()[1] ? this.timestamp : (java.lang.Long) defaultValue(fields()[1]); record.metricName = fieldSetFlags()[2] ? this.metricName : (java.lang.String) defaultValue(fields()[2]); record.metricValue = fieldSetFlags()[3] ? this.metricValue : (java.lang.Double) defaultValue(fields()[3]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } private static final org.apache.avro.io.DatumWriter WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$); @Override public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException { WRITER$.write(this, SpecificData.getEncoder(out)); } private static final org.apache.avro.io.DatumReader READER$ = new org.apache.avro.specific.SpecificDatumReader(SCHEMA$); @Override public void readExternal(java.io.ObjectInput in) throws java.io.IOException { READER$.read(this, SpecificData.getDecoder(in)); } }