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

wavefront.report.ReportEvent Maven / Gradle / Ivy

The newest version!
/**
 * Autogenerated by Avro
 *
 * DO NOT EDIT DIRECTLY
 */
package wavefront.report;

import org.apache.avro.generic.GenericArray;
import org.apache.avro.specific.SpecificData;
import org.apache.avro.util.Utf8;
import org.apache.avro.message.BinaryMessageEncoder;
import org.apache.avro.message.BinaryMessageDecoder;
import org.apache.avro.message.SchemaStore;

@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 BinaryMessageEncoder instance used by this class.
   * @return the message encoder used by this class
   */
  public static BinaryMessageEncoder getEncoder() {
    return ENCODER;
  }

  /**
   * Return the BinaryMessageDecoder instance used by this class.
   * @return the message decoder 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
   * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore
   */
  public static BinaryMessageDecoder createDecoder(SchemaStore resolver) {
    return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver);
  }

  /**
   * Serializes this ReportEvent to a ByteBuffer.
   * @return a buffer holding the serialized data for this instance
   * @throws java.io.IOException if this instance could not be serialized
   */
  public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException {
    return ENCODER.encode(this);
  }

  /**
   * Deserializes a ReportEvent from a ByteBuffer.
   * @param b a byte buffer holding serialized data for an instance of this class
   * @return a ReportEvent instance decoded from the given buffer
   * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class
   */
  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.specific.SpecificData getSpecificData() { return MODEL$; }
  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 = value$ != null ? value$.toString() : null; 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 long getStartTime() {
    return startTime;
  }


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


  /**
   * Sets the value of the 'endTime' field.
   * @param value the value to set.
   */
      public void setEndTime(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.
   */
  @org.apache.avro.specific.AvroGenerated
  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 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 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 (org.apache.avro.AvroMissingFieldException e) {
        throw e;
      } 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));
  }

  @Override protected boolean hasCustomCoders() { return true; }

  @Override public void customEncode(org.apache.avro.io.Encoder out)
    throws java.io.IOException
  {
    out.writeString(this.name);

    out.writeLong(this.startTime);

    out.writeLong(this.endTime);

    long size0 = this.annotations.size();
    out.writeMapStart();
    out.setItemCount(size0);
    long actualSize0 = 0;
    for (java.util.Map.Entry e0: this.annotations.entrySet()) {
      actualSize0++;
      out.startItem();
      out.writeString(e0.getKey());
      java.lang.String v0 = e0.getValue();
      out.writeString(v0);
    }
    out.writeMapEnd();
    if (actualSize0 != size0)
      throw new java.util.ConcurrentModificationException("Map-size written was " + size0 + ", but element count was " + actualSize0 + ".");

    long size1 = this.hosts.size();
    out.writeArrayStart();
    out.setItemCount(size1);
    long actualSize1 = 0;
    for (java.lang.String e1: this.hosts) {
      actualSize1++;
      out.startItem();
      out.writeString(e1);
    }
    out.writeArrayEnd();
    if (actualSize1 != size1)
      throw new java.util.ConcurrentModificationException("Array-size written was " + size1 + ", but element count was " + actualSize1 + ".");

    if (this.tags == null) {
      out.writeIndex(0);
      out.writeNull();
    } else {
      out.writeIndex(1);
      long size2 = this.tags.size();
      out.writeArrayStart();
      out.setItemCount(size2);
      long actualSize2 = 0;
      for (java.lang.String e2: this.tags) {
        actualSize2++;
        out.startItem();
        out.writeString(e2);
      }
      out.writeArrayEnd();
      if (actualSize2 != size2)
        throw new java.util.ConcurrentModificationException("Array-size written was " + size2 + ", but element count was " + actualSize2 + ".");
    }

    if (this.dimensions == null) {
      out.writeIndex(0);
      out.writeNull();
    } else {
      out.writeIndex(1);
      long size3 = this.dimensions.size();
      out.writeMapStart();
      out.setItemCount(size3);
      long actualSize3 = 0;
      for (java.util.Map.Entry> e3: this.dimensions.entrySet()) {
        actualSize3++;
        out.startItem();
        out.writeString(e3.getKey());
        java.util.List v3 = e3.getValue();
        long size4 = v3.size();
        out.writeArrayStart();
        out.setItemCount(size4);
        long actualSize4 = 0;
        for (java.lang.String e4: v3) {
          actualSize4++;
          out.startItem();
          out.writeString(e4);
        }
        out.writeArrayEnd();
        if (actualSize4 != size4)
          throw new java.util.ConcurrentModificationException("Array-size written was " + size4 + ", but element count was " + actualSize4 + ".");
      }
      out.writeMapEnd();
      if (actualSize3 != size3)
      throw new java.util.ConcurrentModificationException("Map-size written was " + size3 + ", but element count was " + actualSize3 + ".");
    }

  }

  @Override public void customDecode(org.apache.avro.io.ResolvingDecoder in)
    throws java.io.IOException
  {
    org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff();
    if (fieldOrder == null) {
      this.name = in.readString();

      this.startTime = in.readLong();

      this.endTime = in.readLong();

      long size0 = in.readMapStart();
      java.util.Map m0 = this.annotations; // Need fresh name due to limitation of macro system
      if (m0 == null) {
        m0 = new java.util.HashMap((int)size0);
        this.annotations = m0;
      } else m0.clear();
      for ( ; 0 < size0; size0 = in.mapNext()) {
        for ( ; size0 != 0; size0--) {
          java.lang.String k0 = null;
          k0 = in.readString();
          java.lang.String v0 = null;
          v0 = in.readString();
          m0.put(k0, v0);
        }
      }

      long size1 = in.readArrayStart();
      java.util.List a1 = this.hosts;
      if (a1 == null) {
        a1 = new SpecificData.Array((int)size1, SCHEMA$.getField("hosts").schema());
        this.hosts = a1;
      } else a1.clear();
      SpecificData.Array ga1 = (a1 instanceof SpecificData.Array ? (SpecificData.Array)a1 : null);
      for ( ; 0 < size1; size1 = in.arrayNext()) {
        for ( ; size1 != 0; size1--) {
          java.lang.String e1 = (ga1 != null ? ga1.peek() : null);
          e1 = in.readString();
          a1.add(e1);
        }
      }

      if (in.readIndex() != 1) {
        in.readNull();
        this.tags = null;
      } else {
        long size2 = in.readArrayStart();
        java.util.List a2 = this.tags;
        if (a2 == null) {
          a2 = new SpecificData.Array((int)size2, SCHEMA$.getField("tags").schema().getTypes().get(1));
          this.tags = a2;
        } else a2.clear();
        SpecificData.Array ga2 = (a2 instanceof SpecificData.Array ? (SpecificData.Array)a2 : null);
        for ( ; 0 < size2; size2 = in.arrayNext()) {
          for ( ; size2 != 0; size2--) {
            java.lang.String e2 = (ga2 != null ? ga2.peek() : null);
            e2 = in.readString();
            a2.add(e2);
          }
        }
      }

      if (in.readIndex() != 1) {
        in.readNull();
        this.dimensions = null;
      } else {
        long size3 = in.readMapStart();
        java.util.Map> m3 = this.dimensions; // Need fresh name due to limitation of macro system
        if (m3 == null) {
          m3 = new java.util.HashMap>((int)size3);
          this.dimensions = m3;
        } else m3.clear();
        for ( ; 0 < size3; size3 = in.mapNext()) {
          for ( ; size3 != 0; size3--) {
            java.lang.String k3 = null;
            k3 = in.readString();
            java.util.List v3 = null;
            long size4 = in.readArrayStart();
            java.util.List a4 = v3;
            if (a4 == null) {
              a4 = new SpecificData.Array((int)size4, SCHEMA$.getField("dimensions").schema().getTypes().get(1).getValueType());
              v3 = a4;
            } else a4.clear();
            SpecificData.Array ga4 = (a4 instanceof SpecificData.Array ? (SpecificData.Array)a4 : null);
            for ( ; 0 < size4; size4 = in.arrayNext()) {
              for ( ; size4 != 0; size4--) {
                java.lang.String e4 = (ga4 != null ? ga4.peek() : null);
                e4 = in.readString();
                a4.add(e4);
              }
            }
            m3.put(k3, v3);
          }
        }
      }

    } else {
      for (int i = 0; i < 7; i++) {
        switch (fieldOrder[i].pos()) {
        case 0:
          this.name = in.readString();
          break;

        case 1:
          this.startTime = in.readLong();
          break;

        case 2:
          this.endTime = in.readLong();
          break;

        case 3:
          long size0 = in.readMapStart();
          java.util.Map m0 = this.annotations; // Need fresh name due to limitation of macro system
          if (m0 == null) {
            m0 = new java.util.HashMap((int)size0);
            this.annotations = m0;
          } else m0.clear();
          for ( ; 0 < size0; size0 = in.mapNext()) {
            for ( ; size0 != 0; size0--) {
              java.lang.String k0 = null;
              k0 = in.readString();
              java.lang.String v0 = null;
              v0 = in.readString();
              m0.put(k0, v0);
            }
          }
          break;

        case 4:
          long size1 = in.readArrayStart();
          java.util.List a1 = this.hosts;
          if (a1 == null) {
            a1 = new SpecificData.Array((int)size1, SCHEMA$.getField("hosts").schema());
            this.hosts = a1;
          } else a1.clear();
          SpecificData.Array ga1 = (a1 instanceof SpecificData.Array ? (SpecificData.Array)a1 : null);
          for ( ; 0 < size1; size1 = in.arrayNext()) {
            for ( ; size1 != 0; size1--) {
              java.lang.String e1 = (ga1 != null ? ga1.peek() : null);
              e1 = in.readString();
              a1.add(e1);
            }
          }
          break;

        case 5:
          if (in.readIndex() != 1) {
            in.readNull();
            this.tags = null;
          } else {
            long size2 = in.readArrayStart();
            java.util.List a2 = this.tags;
            if (a2 == null) {
              a2 = new SpecificData.Array((int)size2, SCHEMA$.getField("tags").schema().getTypes().get(1));
              this.tags = a2;
            } else a2.clear();
            SpecificData.Array ga2 = (a2 instanceof SpecificData.Array ? (SpecificData.Array)a2 : null);
            for ( ; 0 < size2; size2 = in.arrayNext()) {
              for ( ; size2 != 0; size2--) {
                java.lang.String e2 = (ga2 != null ? ga2.peek() : null);
                e2 = in.readString();
                a2.add(e2);
              }
            }
          }
          break;

        case 6:
          if (in.readIndex() != 1) {
            in.readNull();
            this.dimensions = null;
          } else {
            long size3 = in.readMapStart();
            java.util.Map> m3 = this.dimensions; // Need fresh name due to limitation of macro system
            if (m3 == null) {
              m3 = new java.util.HashMap>((int)size3);
              this.dimensions = m3;
            } else m3.clear();
            for ( ; 0 < size3; size3 = in.mapNext()) {
              for ( ; size3 != 0; size3--) {
                java.lang.String k3 = null;
                k3 = in.readString();
                java.util.List v3 = null;
                long size4 = in.readArrayStart();
                java.util.List a4 = v3;
                if (a4 == null) {
                  a4 = new SpecificData.Array((int)size4, SCHEMA$.getField("dimensions").schema().getTypes().get(1).getValueType());
                  v3 = a4;
                } else a4.clear();
                SpecificData.Array ga4 = (a4 instanceof SpecificData.Array ? (SpecificData.Array)a4 : null);
                for ( ; 0 < size4; size4 = in.arrayNext()) {
                  for ( ; size4 != 0; size4--) {
                    java.lang.String e4 = (ga4 != null ? ga4.peek() : null);
                    e4 = in.readString();
                    a4.add(e4);
                  }
                }
                m3.put(k3, v3);
              }
            }
          }
          break;

        default:
          throw new java.io.IOException("Corrupt ResolvingDecoder.");
        }
      }
    }
  }
}














© 2015 - 2024 Weber Informatics LLC | Privacy Policy