All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sunnylabs.report.ReportPoint Maven / Gradle / Ivy

There is a newer version: 4.8
Show newest version
/**
 * Autogenerated by Avro
 * 
 * DO NOT EDIT DIRECTLY
 */
package sunnylabs.report;  
@SuppressWarnings("all")
public class ReportPoint 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\":\"ReportPoint\",\"namespace\":\"sunnylabs.report\",\"fields\":[{\"name\":\"metric\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"timestamp\",\"type\":\"long\"},{\"name\":\"value\",\"type\":[\"double\",\"long\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"host\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"default\":\"unknown\"},{\"name\":\"table\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"default\":\"tsdb\"},{\"name\":\"annotations\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"avro.java.string\":\"String\"},\"default\":{}}]}");
  private java.lang.String metric;
  private long timestamp;
  private java.lang.Object value;
  private java.lang.String host;
  private java.lang.String table;
  private java.util.Map annotations;

  /**
   * Default constructor.
   */
  public ReportPoint() {}

  /**
   * All-args constructor.
   */
  public ReportPoint(java.lang.String metric, java.lang.Long timestamp, java.lang.Object value, java.lang.String host, java.lang.String table, java.util.Map annotations) {
    this.metric = metric;
    this.timestamp = timestamp;
    this.value = value;
    this.host = host;
    this.table = table;
    this.annotations = annotations;
  }

  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 metric;
    case 1: return timestamp;
    case 2: return value;
    case 3: return host;
    case 4: return table;
    case 5: return annotations;
    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: metric = (java.lang.String)value$; break;
    case 1: timestamp = (java.lang.Long)value$; break;
    case 2: value = (java.lang.Object)value$; break;
    case 3: host = (java.lang.String)value$; break;
    case 4: table = (java.lang.String)value$; break;
    case 5: annotations = (java.util.Map)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'metric' field.
   */
  public java.lang.String getMetric() {
    return metric;
  }

  /**
   * Sets the value of the 'metric' field.
   * @param value the value to set.
   */
  public void setMetric(java.lang.String value) {
    this.metric = 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;
  }

  /**
   * Gets the value of the 'value' field.
   */
  public java.lang.Object getValue() {
    return value;
  }

  /**
   * Sets the value of the 'value' field.
   * @param value the value to set.
   */
  public void setValue(java.lang.Double value) {
    this.value = value;
  }
  public void setValue(java.lang.Long value) {
    this.value = value;
  }
  public void setValue(java.lang.String value) {
    this.value = value;
  }

  /**
   * Gets the value of the 'host' field.
   */
  public java.lang.String getHost() {
    return host;
  }

  /**
   * Sets the value of the 'host' field.
   * @param value the value to set.
   */
  public void setHost(java.lang.String value) {
    this.host = value;
  }

  /**
   * 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 'annotations' field.
   */
  public java.util.Map getAnnotations() {
    return annotations;
  }

  /**
   * Sets the value of the 'annotations' field.
   * @param value the value to set.
   */
  public void setAnnotations(java.util.Map value) {
    this.annotations = value;
  }

  /** Creates a new ReportPoint RecordBuilder */
  public static sunnylabs.report.ReportPoint.Builder newBuilder() {
    return new sunnylabs.report.ReportPoint.Builder();
  }
  
  /** Creates a new ReportPoint RecordBuilder by copying an existing Builder */
  public static sunnylabs.report.ReportPoint.Builder newBuilder(sunnylabs.report.ReportPoint.Builder other) {
    return new sunnylabs.report.ReportPoint.Builder(other);
  }
  
  /** Creates a new ReportPoint RecordBuilder by copying an existing ReportPoint instance */
  public static sunnylabs.report.ReportPoint.Builder newBuilder(sunnylabs.report.ReportPoint other) {
    return new sunnylabs.report.ReportPoint.Builder(other);
  }
  
  /**
   * RecordBuilder for ReportPoint instances.
   */
  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
    implements org.apache.avro.data.RecordBuilder {

    private java.lang.String metric;
    private long timestamp;
    private java.lang.Object value;
    private java.lang.String host;
    private java.lang.String table;
    private java.util.Map annotations;

    /** Creates a new Builder */
    private Builder() {
      super(sunnylabs.report.ReportPoint.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(sunnylabs.report.ReportPoint.Builder other) {
      super(other);
    }
    
    /** Creates a Builder by copying an existing ReportPoint instance */
    private Builder(sunnylabs.report.ReportPoint other) {
            super(sunnylabs.report.ReportPoint.SCHEMA$);
      if (isValidValue(fields()[0], other.metric)) {
        this.metric = (java.lang.String) data().deepCopy(fields()[0].schema(), other.metric);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.timestamp)) {
        this.timestamp = (java.lang.Long) data().deepCopy(fields()[1].schema(), other.timestamp);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.value)) {
        this.value = (java.lang.Object) data().deepCopy(fields()[2].schema(), other.value);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.host)) {
        this.host = (java.lang.String) data().deepCopy(fields()[3].schema(), other.host);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.table)) {
        this.table = (java.lang.String) data().deepCopy(fields()[4].schema(), other.table);
        fieldSetFlags()[4] = true;
      }
      if (isValidValue(fields()[5], other.annotations)) {
        this.annotations = (java.util.Map) data().deepCopy(fields()[5].schema(), other.annotations);
        fieldSetFlags()[5] = true;
      }
    }

    /** Gets the value of the 'metric' field */
    public java.lang.String getMetric() {
      return metric;
    }

    /** Sets the value of the 'metric' field */
    public sunnylabs.report.ReportPoint.Builder setMetric(java.lang.String value) {
      validate(fields()[0], value);
      this.metric = value;
      fieldSetFlags()[0] = true;
      return this;
    }

    /** Checks whether the 'metric' field has been set */
    public boolean hasMetric() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'metric' field */
    public sunnylabs.report.ReportPoint.Builder clearMetric() {
      metric = null;
      fieldSetFlags()[0] = 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.ReportPoint.Builder setTimestamp(long value) {
      validate(fields()[1], value);
      this.timestamp = value;
      fieldSetFlags()[1] = true;
      return this;
    }

    /** Checks whether the 'timestamp' field has been set */
    public boolean hasTimestamp() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'timestamp' field */
    public sunnylabs.report.ReportPoint.Builder clearTimestamp() {
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'value' field */
    public java.lang.Object getValue() {
      return value;
    }

    /** Sets the value of the 'value' field */
    public sunnylabs.report.ReportPoint.Builder setValue(double value) {
      validate(fields()[2], value);
      this.value = value;
      fieldSetFlags()[2] = true;
      return this;
    }
    /** Sets the value of the 'value' field */
    public sunnylabs.report.ReportPoint.Builder setValue(long value) {
      validate(fields()[2], value);
      this.value = value;
      fieldSetFlags()[2] = true;
      return this;
    }
    /** Sets the value of the 'value' field */
    public sunnylabs.report.ReportPoint.Builder setValue(java.lang.String value) {
      validate(fields()[2], value);
      this.value = value;
      fieldSetFlags()[2] = true;
      return this;
    }

    /** Checks whether the 'value' field has been set */
    public boolean hasValue() {
      return fieldSetFlags()[2];
    }
    
    /** Clears the value of the 'value' field */
    public sunnylabs.report.ReportPoint.Builder clearValue() {
      value = null;
      fieldSetFlags()[2] = false;
      return this;
    }

    /** Gets the value of the 'host' field */
    public java.lang.String getHost() {
      return host;
    }

    /** Sets the value of the 'host' field */
    public sunnylabs.report.ReportPoint.Builder setHost(java.lang.String value) {
      validate(fields()[3], value);
      this.host = value;
      fieldSetFlags()[3] = true;
      return this;
    }

    /** Checks whether the 'host' field has been set */
    public boolean hasHost() {
      return fieldSetFlags()[3];
    }
    
    /** Clears the value of the 'host' field */
    public sunnylabs.report.ReportPoint.Builder clearHost() {
      host = null;
      fieldSetFlags()[3] = false;
      return this;
    }

    /** Gets the value of the 'table' field */
    public java.lang.String getTable() {
      return table;
    }

    /** Sets the value of the 'table' field */
    public sunnylabs.report.ReportPoint.Builder setTable(java.lang.String value) {
      validate(fields()[4], value);
      this.table = value;
      fieldSetFlags()[4] = true;
      return this;
    }

    /** Checks whether the 'table' field has been set */
    public boolean hasTable() {
      return fieldSetFlags()[4];
    }
    
    /** Clears the value of the 'table' field */
    public sunnylabs.report.ReportPoint.Builder clearTable() {
      table = null;
      fieldSetFlags()[4] = false;
      return this;
    }

    /** Gets the value of the 'annotations' field */
    public java.util.Map getAnnotations() {
      return annotations;
    }

    /** Sets the value of the 'annotations' field */
    public sunnylabs.report.ReportPoint.Builder setAnnotations(java.util.Map value) {
      validate(fields()[5], value);
      this.annotations = value;
      fieldSetFlags()[5] = true;
      return this;
    }

    /** Checks whether the 'annotations' field has been set */
    public boolean hasAnnotations() {
      return fieldSetFlags()[5];
    }
    
    /** Clears the value of the 'annotations' field */
    public sunnylabs.report.ReportPoint.Builder clearAnnotations() {
      annotations = null;
      fieldSetFlags()[5] = false;
      return this;
    }

    @Override
    public ReportPoint build() {
      try {
        ReportPoint record = new ReportPoint();
        record.metric = fieldSetFlags()[0] ? this.metric : (java.lang.String) defaultValue(fields()[0]);
        record.timestamp = fieldSetFlags()[1] ? this.timestamp : (java.lang.Long) defaultValue(fields()[1]);
        record.value = fieldSetFlags()[2] ? this.value : (java.lang.Object) defaultValue(fields()[2]);
        record.host = fieldSetFlags()[3] ? this.host : (java.lang.String) defaultValue(fields()[3]);
        record.table = fieldSetFlags()[4] ? this.table : (java.lang.String) defaultValue(fields()[4]);
        record.annotations = fieldSetFlags()[5] ? this.annotations : (java.util.Map) defaultValue(fields()[5]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy