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

Energistics.Protocol.ChannelStreaming.ChannelData Maven / Gradle / Ivy

The newest version!
/**
 * Autogenerated by Avro
 *
 * DO NOT EDIT DIRECTLY
 */
package Energistics.Protocol.ChannelStreaming;

import org.apache.avro.specific.SpecificData;

@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class ChannelData extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  private static final long serialVersionUID = 8712952285370550682L;
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ChannelData\",\"namespace\":\"Energistics.Protocol.ChannelStreaming\",\"fields\":[{\"name\":\"data\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"DataItem\",\"namespace\":\"Energistics.Datatypes.ChannelData\",\"fields\":[{\"name\":\"indexes\",\"type\":{\"type\":\"array\",\"items\":\"long\"}},{\"name\":\"channelId\",\"type\":\"long\"},{\"name\":\"value\",\"type\":{\"type\":\"record\",\"name\":\"DataValue\",\"namespace\":\"Energistics.Datatypes\",\"fields\":[{\"name\":\"item\",\"type\":[\"null\",\"double\",\"float\",\"int\",\"long\",\"string\",{\"type\":\"record\",\"name\":\"ArrayOfDouble\",\"fields\":[{\"name\":\"values\",\"type\":{\"type\":\"array\",\"items\":\"double\"}}],\"fullName\":\"Energistics.Datatypes.ArrayOfDouble\",\"depends\":[]},\"boolean\",\"bytes\"]}],\"fullName\":\"Energistics.Datatypes.DataValue\",\"depends\":[\"Energistics.Datatypes.ArrayOfDouble\"]}},{\"name\":\"valueAttributes\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"DataAttribute\",\"namespace\":\"Energistics.Datatypes\",\"fields\":[{\"name\":\"attributeId\",\"type\":\"int\"},{\"name\":\"attributeValue\",\"type\":\"DataValue\"}],\"fullName\":\"Energistics.Datatypes.DataAttribute\",\"depends\":[\"Energistics.Datatypes.DataValue\"]}}}],\"fullName\":\"Energistics.Datatypes.ChannelData.DataItem\",\"depends\":[\"Energistics.Datatypes.DataValue\",\"Energistics.Datatypes.DataAttribute\"]}}}],\"messageType\":\"3\",\"protocol\":\"1\",\"senderRole\":\"producer\",\"protocolRoles\":\"producer,consumer\",\"fullName\":\"Energistics.Protocol.ChannelStreaming.ChannelData\",\"depends\":[\"Energistics.Datatypes.ChannelData.DataItem\"]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  @Deprecated public java.util.List data;

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

  /**
   * All-args constructor.
   * @param data The new value for data
   */
  public ChannelData(java.util.List data) {
    this.data = data;
  }

  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 data;
    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: data = (java.util.List)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'data' field.
   * @return The value of the 'data' field.
   */
  public java.util.List getData() {
    return data;
  }

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

  /**
   * Creates a new ChannelData RecordBuilder.
   * @return A new ChannelData RecordBuilder
   */
  public static Energistics.Protocol.ChannelStreaming.ChannelData.Builder newBuilder() {
    return new Energistics.Protocol.ChannelStreaming.ChannelData.Builder();
  }

  /**
   * Creates a new ChannelData RecordBuilder by copying an existing Builder.
   * @param other The existing builder to copy.
   * @return A new ChannelData RecordBuilder
   */
  public static Energistics.Protocol.ChannelStreaming.ChannelData.Builder newBuilder(Energistics.Protocol.ChannelStreaming.ChannelData.Builder other) {
    return new Energistics.Protocol.ChannelStreaming.ChannelData.Builder(other);
  }

  /**
   * Creates a new ChannelData RecordBuilder by copying an existing ChannelData instance.
   * @param other The existing instance to copy.
   * @return A new ChannelData RecordBuilder
   */
  public static Energistics.Protocol.ChannelStreaming.ChannelData.Builder newBuilder(Energistics.Protocol.ChannelStreaming.ChannelData other) {
    return new Energistics.Protocol.ChannelStreaming.ChannelData.Builder(other);
  }

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

    private java.util.List data;

    /** 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(Energistics.Protocol.ChannelStreaming.ChannelData.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.data)) {
        this.data = data().deepCopy(fields()[0].schema(), other.data);
        fieldSetFlags()[0] = true;
      }
    }

    /**
     * Creates a Builder by copying an existing ChannelData instance
     * @param other The existing instance to copy.
     */
    private Builder(Energistics.Protocol.ChannelStreaming.ChannelData other) {
            super(SCHEMA$);
      if (isValidValue(fields()[0], other.data)) {
        this.data = data().deepCopy(fields()[0].schema(), other.data);
        fieldSetFlags()[0] = true;
      }
    }

    /**
      * Gets the value of the 'data' field.
      * @return The value.
      */
    public java.util.List getData() {
      return data;
    }

    /**
      * Sets the value of the 'data' field.
      * @param value The value of 'data'.
      * @return This builder.
      */
    public Energistics.Protocol.ChannelStreaming.ChannelData.Builder setData(java.util.List value) {
      validate(fields()[0], value);
      this.data = value;
      fieldSetFlags()[0] = true;
      return this;
    }

    /**
      * Checks whether the 'data' field has been set.
      * @return True if the 'data' field has been set, false otherwise.
      */
    public boolean hasData() {
      return fieldSetFlags()[0];
    }


    /**
      * Clears the value of the 'data' field.
      * @return This builder.
      */
    public Energistics.Protocol.ChannelStreaming.ChannelData.Builder clearData() {
      data = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    @Override
    public ChannelData build() {
      try {
        ChannelData record = new ChannelData();
        record.data = fieldSetFlags()[0] ? this.data : (java.util.List) defaultValue(fields()[0]);
        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));
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy