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

wavefront.report.ReportEvent Maven / Gradle / Ivy

/**
 * Autogenerated by Avro
 *
 * DO NOT EDIT DIRECTLY
 */
package wavefront.report;

import org.apache.avro.specific.SpecificData;
import org.apache.avro.message.BinaryMessageEncoder;
import org.apache.avro.message.BinaryMessageDecoder;
import org.apache.avro.message.SchemaStore;

@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class ReportEvent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  private static final long serialVersionUID = -1339357568892642139L;
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ReportEvent\",\"namespace\":\"wavefront.report\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"startTime\",\"type\":\"long\"},{\"name\":\"endTime\",\"type\":\"long\"},{\"name\":\"annotations\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"avro.java.string\":\"String\"}},{\"name\":\"hosts\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},\"default\":[]},{\"name\":\"tags\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}],\"default\":null},{\"name\":\"dimensions\",\"type\":[\"null\",{\"type\":\"map\",\"values\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},\"avro.java.string\":\"String\"}],\"default\":null}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }

  private static SpecificData MODEL$ = new SpecificData();

  private static final BinaryMessageEncoder ENCODER =
      new BinaryMessageEncoder(MODEL$, SCHEMA$);

  private static final BinaryMessageDecoder DECODER =
      new BinaryMessageDecoder(MODEL$, SCHEMA$);

  /**
   * Return the BinaryMessageDecoder instance used by this class.
   */
  public static BinaryMessageDecoder getDecoder() {
    return DECODER;
  }

  /**
   * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}.
   * @param resolver a {@link SchemaStore} used to find schemas by fingerprint
   */
  public static BinaryMessageDecoder createDecoder(SchemaStore resolver) {
    return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver);
  }

  /** Serializes this ReportEvent to a ByteBuffer. */
  public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException {
    return ENCODER.encode(this);
  }

  /** Deserializes a ReportEvent from a ByteBuffer. */
  public static ReportEvent fromByteBuffer(
      java.nio.ByteBuffer b) throws java.io.IOException {
    return DECODER.decode(b);
  }

  @Deprecated public java.lang.String name;
  @Deprecated public long startTime;
  @Deprecated public long endTime;
  @Deprecated public java.util.Map annotations;
  @Deprecated public java.util.List hosts;
  @Deprecated public java.util.List tags;
  @Deprecated public java.util.Map> dimensions;

  /**
   * 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 ReportEvent() {}

  /**
   * All-args constructor.
   * @param name The new value for name
   * @param startTime The new value for startTime
   * @param endTime The new value for endTime
   * @param annotations The new value for annotations
   * @param hosts The new value for hosts
   * @param tags The new value for tags
   * @param dimensions The new value for dimensions
   */
  public ReportEvent(java.lang.String name, java.lang.Long startTime, java.lang.Long endTime, java.util.Map annotations, java.util.List hosts, java.util.List tags, java.util.Map> dimensions) {
    this.name = name;
    this.startTime = startTime;
    this.endTime = endTime;
    this.annotations = annotations;
    this.hosts = hosts;
    this.tags = tags;
    this.dimensions = dimensions;
  }

  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 name;
    case 1: return startTime;
    case 2: return endTime;
    case 3: return annotations;
    case 4: return hosts;
    case 5: return tags;
    case 6: return dimensions;
    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: name = (java.lang.String)value$; break;
    case 1: startTime = (java.lang.Long)value$; break;
    case 2: endTime = (java.lang.Long)value$; break;
    case 3: annotations = (java.util.Map)value$; break;
    case 4: hosts = (java.util.List)value$; break;
    case 5: tags = (java.util.List)value$; break;
    case 6: dimensions = (java.util.Map>)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'name' field.
   * @return The value of the 'name' field.
   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * Sets the value of the 'name' field.
       * @param value the value to set.
   */
        public void setName(java.lang.String value) {
    this.name = value;
    }
    
  /**
   * Gets the value of the 'startTime' field.
   * @return The value of the 'startTime' field.
   */
  public java.lang.Long getStartTime() {
    return startTime;
  }

  /**
   * Sets the value of the 'startTime' field.
       * @param value the value to set.
   */
        public void setStartTime(java.lang.Long value) {
    this.startTime = value;
    }
    
  /**
   * Gets the value of the 'endTime' field.
   * @return The value of the 'endTime' field.
   */
  public java.lang.Long getEndTime() {
    return endTime;
  }

  /**
   * Sets the value of the 'endTime' field.
       * @param value the value to set.
   */
        public void setEndTime(java.lang.Long value) {
    this.endTime = value;
    }
    
  /**
   * Gets the value of the 'annotations' field.
   * @return 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;
    }
    
  /**
   * Gets the value of the 'hosts' field.
   * @return The value of the 'hosts' field.
   */
  public java.util.List getHosts() {
    return hosts;
  }

  /**
   * Sets the value of the 'hosts' field.
       * @param value the value to set.
   */
        public void setHosts(java.util.List value) {
    this.hosts = value;
    }
    
  /**
   * Gets the value of the 'tags' field.
   * @return The value of the 'tags' field.
   */
  public java.util.List getTags() {
    return tags;
  }

  /**
   * Sets the value of the 'tags' field.
       * @param value the value to set.
   */
        public void setTags(java.util.List value) {
    this.tags = value;
    }
    
  /**
   * Gets the value of the 'dimensions' field.
   * @return The value of the 'dimensions' field.
   */
  public java.util.Map> getDimensions() {
    return dimensions;
  }

  /**
   * Sets the value of the 'dimensions' field.
       * @param value the value to set.
   */
        public void setDimensions(java.util.Map> value) {
    this.dimensions = value;
    }
    
  /**
   * Creates a new ReportEvent RecordBuilder.
   * @return A new ReportEvent RecordBuilder
   */
  public static wavefront.report.ReportEvent.Builder newBuilder() {
    return new wavefront.report.ReportEvent.Builder();
  }

  /**
   * Creates a new ReportEvent RecordBuilder by copying an existing Builder.
   * @param other The existing builder to copy.
   * @return A new ReportEvent RecordBuilder
   */
  public static wavefront.report.ReportEvent.Builder newBuilder(wavefront.report.ReportEvent.Builder other) {
    if (other == null) {
      return new wavefront.report.ReportEvent.Builder();
    } else {
      return new wavefront.report.ReportEvent.Builder(other);
    }
  }

  /**
   * Creates a new ReportEvent RecordBuilder by copying an existing ReportEvent instance.
   * @param other The existing instance to copy.
   * @return A new ReportEvent RecordBuilder
   */
  public static wavefront.report.ReportEvent.Builder newBuilder(wavefront.report.ReportEvent other) {
    if (other == null) {
      return new wavefront.report.ReportEvent.Builder();
    } else {
      return new wavefront.report.ReportEvent.Builder(other);
    }
  }

  /**
   * RecordBuilder for ReportEvent instances.
   */
  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
    implements org.apache.avro.data.RecordBuilder {

    private java.lang.String name;
    private long startTime;
    private long endTime;
    private java.util.Map annotations;
    private java.util.List hosts;
    private java.util.List tags;
    private java.util.Map> dimensions;

    /** 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(wavefront.report.ReportEvent.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.name)) {
        this.name = data().deepCopy(fields()[0].schema(), other.name);
        fieldSetFlags()[0] = other.fieldSetFlags()[0];
      }
      if (isValidValue(fields()[1], other.startTime)) {
        this.startTime = data().deepCopy(fields()[1].schema(), other.startTime);
        fieldSetFlags()[1] = other.fieldSetFlags()[1];
      }
      if (isValidValue(fields()[2], other.endTime)) {
        this.endTime = data().deepCopy(fields()[2].schema(), other.endTime);
        fieldSetFlags()[2] = other.fieldSetFlags()[2];
      }
      if (isValidValue(fields()[3], other.annotations)) {
        this.annotations = data().deepCopy(fields()[3].schema(), other.annotations);
        fieldSetFlags()[3] = other.fieldSetFlags()[3];
      }
      if (isValidValue(fields()[4], other.hosts)) {
        this.hosts = data().deepCopy(fields()[4].schema(), other.hosts);
        fieldSetFlags()[4] = other.fieldSetFlags()[4];
      }
      if (isValidValue(fields()[5], other.tags)) {
        this.tags = data().deepCopy(fields()[5].schema(), other.tags);
        fieldSetFlags()[5] = other.fieldSetFlags()[5];
      }
      if (isValidValue(fields()[6], other.dimensions)) {
        this.dimensions = data().deepCopy(fields()[6].schema(), other.dimensions);
        fieldSetFlags()[6] = other.fieldSetFlags()[6];
      }
    }

    /**
     * Creates a Builder by copying an existing ReportEvent instance
     * @param other The existing instance to copy.
     */
    private Builder(wavefront.report.ReportEvent other) {
      super(SCHEMA$);
      if (isValidValue(fields()[0], other.name)) {
        this.name = data().deepCopy(fields()[0].schema(), other.name);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.startTime)) {
        this.startTime = data().deepCopy(fields()[1].schema(), other.startTime);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.endTime)) {
        this.endTime = data().deepCopy(fields()[2].schema(), other.endTime);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.annotations)) {
        this.annotations = data().deepCopy(fields()[3].schema(), other.annotations);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.hosts)) {
        this.hosts = data().deepCopy(fields()[4].schema(), other.hosts);
        fieldSetFlags()[4] = true;
      }
      if (isValidValue(fields()[5], other.tags)) {
        this.tags = data().deepCopy(fields()[5].schema(), other.tags);
        fieldSetFlags()[5] = true;
      }
      if (isValidValue(fields()[6], other.dimensions)) {
        this.dimensions = data().deepCopy(fields()[6].schema(), other.dimensions);
        fieldSetFlags()[6] = true;
      }
    }

    /**
      * Gets the value of the 'name' field.
      * @return The value.
      */
    public java.lang.String getName() {
      return name;
    }
    
    /**
    * Sets the value of the 'name' field.
            * @param value The value of 'name'.
    * @return This builder.
    */
    public wavefront.report.ReportEvent.Builder setName(java.lang.String value) {
    validate(fields()[0], value);
            this.name = value;
    fieldSetFlags()[0] = true;
    return this;
    }
    
    /**
      * Checks whether the 'name' field has been set.
      * @return True if the 'name' field has been set, false otherwise.
      */
    public boolean hasName() {
      return fieldSetFlags()[0];
    }


    /**
      * Clears the value of the 'name' field.
      * @return This builder.
      */
    public wavefront.report.ReportEvent.Builder clearName() {
      name = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /**
      * Gets the value of the 'startTime' field.
      * @return The value.
      */
    public java.lang.Long getStartTime() {
      return startTime;
    }
    
    /**
    * Sets the value of the 'startTime' field.
            * @param value The value of 'startTime'.
    * @return This builder.
    */
    public wavefront.report.ReportEvent.Builder setStartTime(long value) {
    validate(fields()[1], value);
            this.startTime = value;
    fieldSetFlags()[1] = true;
    return this;
    }
    
    /**
      * Checks whether the 'startTime' field has been set.
      * @return True if the 'startTime' field has been set, false otherwise.
      */
    public boolean hasStartTime() {
      return fieldSetFlags()[1];
    }


    /**
      * Clears the value of the 'startTime' field.
      * @return This builder.
      */
    public wavefront.report.ReportEvent.Builder clearStartTime() {
      fieldSetFlags()[1] = false;
      return this;
    }

    /**
      * Gets the value of the 'endTime' field.
      * @return The value.
      */
    public java.lang.Long getEndTime() {
      return endTime;
    }
    
    /**
    * Sets the value of the 'endTime' field.
            * @param value The value of 'endTime'.
    * @return This builder.
    */
    public wavefront.report.ReportEvent.Builder setEndTime(long value) {
    validate(fields()[2], value);
            this.endTime = value;
    fieldSetFlags()[2] = true;
    return this;
    }
    
    /**
      * Checks whether the 'endTime' field has been set.
      * @return True if the 'endTime' field has been set, false otherwise.
      */
    public boolean hasEndTime() {
      return fieldSetFlags()[2];
    }


    /**
      * Clears the value of the 'endTime' field.
      * @return This builder.
      */
    public wavefront.report.ReportEvent.Builder clearEndTime() {
      fieldSetFlags()[2] = false;
      return this;
    }

    /**
      * Gets the value of the 'annotations' field.
      * @return The value.
      */
    public java.util.Map getAnnotations() {
      return annotations;
    }
    
    /**
    * Sets the value of the 'annotations' field.
            * @param value The value of 'annotations'.
    * @return This builder.
    */
    public wavefront.report.ReportEvent.Builder setAnnotations(java.util.Map value) {
    validate(fields()[3], value);
            this.annotations = value;
    fieldSetFlags()[3] = true;
    return this;
    }
    
    /**
      * Checks whether the 'annotations' field has been set.
      * @return True if the 'annotations' field has been set, false otherwise.
      */
    public boolean hasAnnotations() {
      return fieldSetFlags()[3];
    }


    /**
      * Clears the value of the 'annotations' field.
      * @return This builder.
      */
    public wavefront.report.ReportEvent.Builder clearAnnotations() {
      annotations = null;
      fieldSetFlags()[3] = false;
      return this;
    }

    /**
      * Gets the value of the 'hosts' field.
      * @return The value.
      */
    public java.util.List getHosts() {
      return hosts;
    }
    
    /**
    * Sets the value of the 'hosts' field.
            * @param value The value of 'hosts'.
    * @return This builder.
    */
    public wavefront.report.ReportEvent.Builder setHosts(java.util.List value) {
    validate(fields()[4], value);
            this.hosts = value;
    fieldSetFlags()[4] = true;
    return this;
    }
    
    /**
      * Checks whether the 'hosts' field has been set.
      * @return True if the 'hosts' field has been set, false otherwise.
      */
    public boolean hasHosts() {
      return fieldSetFlags()[4];
    }


    /**
      * Clears the value of the 'hosts' field.
      * @return This builder.
      */
    public wavefront.report.ReportEvent.Builder clearHosts() {
      hosts = null;
      fieldSetFlags()[4] = false;
      return this;
    }

    /**
      * Gets the value of the 'tags' field.
      * @return The value.
      */
    public java.util.List getTags() {
      return tags;
    }
    
    /**
    * Sets the value of the 'tags' field.
            * @param value The value of 'tags'.
    * @return This builder.
    */
    public wavefront.report.ReportEvent.Builder setTags(java.util.List value) {
    validate(fields()[5], value);
            this.tags = value;
    fieldSetFlags()[5] = true;
    return this;
    }
    
    /**
      * Checks whether the 'tags' field has been set.
      * @return True if the 'tags' field has been set, false otherwise.
      */
    public boolean hasTags() {
      return fieldSetFlags()[5];
    }


    /**
      * Clears the value of the 'tags' field.
      * @return This builder.
      */
    public wavefront.report.ReportEvent.Builder clearTags() {
      tags = null;
      fieldSetFlags()[5] = false;
      return this;
    }

    /**
      * Gets the value of the 'dimensions' field.
      * @return The value.
      */
    public java.util.Map> getDimensions() {
      return dimensions;
    }
    
    /**
    * Sets the value of the 'dimensions' field.
            * @param value The value of 'dimensions'.
    * @return This builder.
    */
    public wavefront.report.ReportEvent.Builder setDimensions(java.util.Map> value) {
    validate(fields()[6], value);
            this.dimensions = value;
    fieldSetFlags()[6] = true;
    return this;
    }
    
    /**
      * Checks whether the 'dimensions' field has been set.
      * @return True if the 'dimensions' field has been set, false otherwise.
      */
    public boolean hasDimensions() {
      return fieldSetFlags()[6];
    }


    /**
      * Clears the value of the 'dimensions' field.
      * @return This builder.
      */
    public wavefront.report.ReportEvent.Builder clearDimensions() {
      dimensions = null;
      fieldSetFlags()[6] = false;
      return this;
    }

    @Override
    @SuppressWarnings("unchecked")
    public ReportEvent build() {
      try {
        ReportEvent record = new ReportEvent();
        record.name = fieldSetFlags()[0] ? this.name : (java.lang.String) defaultValue(fields()[0]);
        record.startTime = fieldSetFlags()[1] ? this.startTime : (java.lang.Long) defaultValue(fields()[1]);
        record.endTime = fieldSetFlags()[2] ? this.endTime : (java.lang.Long) defaultValue(fields()[2]);
        record.annotations = fieldSetFlags()[3] ? this.annotations : (java.util.Map) defaultValue(fields()[3]);
        record.hosts = fieldSetFlags()[4] ? this.hosts : (java.util.List) defaultValue(fields()[4]);
        record.tags = fieldSetFlags()[5] ? this.tags : (java.util.List) defaultValue(fields()[5]);
        record.dimensions = fieldSetFlags()[6] ? this.dimensions : (java.util.Map>) defaultValue(fields()[6]);
        return record;
      } catch (java.lang.Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }

  @SuppressWarnings("unchecked")
  private static final org.apache.avro.io.DatumWriter
    WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$);

  @Override public void writeExternal(java.io.ObjectOutput out)
    throws java.io.IOException {
    WRITER$.write(this, SpecificData.getEncoder(out));
  }

  @SuppressWarnings("unchecked")
  private static final org.apache.avro.io.DatumReader
    READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$);

  @Override public void readExternal(java.io.ObjectInput in)
    throws java.io.IOException {
    READER$.read(this, SpecificData.getDecoder(in));
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy