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

Energistics.Protocol.DataArray.PutDataArraySlice Maven / Gradle / Ivy

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

import org.apache.avro.specific.SpecificData;

@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class PutDataArraySlice extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  private static final long serialVersionUID = -6205460439187284450L;
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"PutDataArraySlice\",\"namespace\":\"Energistics.Protocol.DataArray\",\"fields\":[{\"name\":\"uri\",\"type\":\"string\"},{\"name\":\"data\",\"type\":{\"type\":\"record\",\"name\":\"AnyArray\",\"namespace\":\"Energistics.Datatypes\",\"fields\":[{\"name\":\"item\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"ArrayOfBoolean\",\"fields\":[{\"name\":\"values\",\"type\":{\"type\":\"array\",\"items\":\"boolean\"}}],\"fullName\":\"Energistics.Datatypes.ArrayOfBoolean\",\"depends\":[]},\"bytes\",{\"type\":\"record\",\"name\":\"ArrayOfInt\",\"fields\":[{\"name\":\"values\",\"type\":{\"type\":\"array\",\"items\":\"int\"}}],\"fullName\":\"Energistics.Datatypes.ArrayOfInt\",\"depends\":[]},{\"type\":\"record\",\"name\":\"ArrayOfLong\",\"fields\":[{\"name\":\"values\",\"type\":{\"type\":\"array\",\"items\":\"long\"}}],\"fullName\":\"Energistics.Datatypes.ArrayOfLong\",\"depends\":[]},{\"type\":\"record\",\"name\":\"ArrayOfFloat\",\"fields\":[{\"name\":\"values\",\"type\":{\"type\":\"array\",\"items\":\"float\"}}],\"fullName\":\"Energistics.Datatypes.ArrayOfFloat\",\"depends\":[]},{\"type\":\"record\",\"name\":\"ArrayOfDouble\",\"fields\":[{\"name\":\"values\",\"type\":{\"type\":\"array\",\"items\":\"double\"}}],\"fullName\":\"Energistics.Datatypes.ArrayOfDouble\",\"depends\":[]}]}],\"fullName\":\"Energistics.Datatypes.AnyArray\",\"depends\":[\"Energistics.Datatypes.ArrayOfBoolean\",\"Energistics.Datatypes.ArrayOfInt\",\"Energistics.Datatypes.ArrayOfLong\",\"Energistics.Datatypes.ArrayOfFloat\",\"Energistics.Datatypes.ArrayOfDouble\"]}},{\"name\":\"dimensions\",\"type\":\"long\"},{\"name\":\"start\",\"type\":{\"type\":\"array\",\"items\":\"long\"}},{\"name\":\"count\",\"type\":{\"type\":\"array\",\"items\":\"long\"}}],\"messageType\":\"5\",\"protocol\":\"7\",\"senderRole\":\"customer\",\"protocolRoles\":\"store,customer\",\"fullName\":\"Energistics.Protocol.DataArray.PutDataArraySlice\",\"depends\":[\"Energistics.Datatypes.AnyArray\"]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  @Deprecated public java.lang.CharSequence uri;
  @Deprecated public Energistics.Datatypes.AnyArray data;
  @Deprecated public long dimensions;
  @Deprecated public java.util.List start;
  @Deprecated public java.util.List count;

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

  /**
   * All-args constructor.
   * @param uri The new value for uri
   * @param data The new value for data
   * @param dimensions The new value for dimensions
   * @param start The new value for start
   * @param count The new value for count
   */
  public PutDataArraySlice(java.lang.CharSequence uri, Energistics.Datatypes.AnyArray data, java.lang.Long dimensions, java.util.List start, java.util.List count) {
    this.uri = uri;
    this.data = data;
    this.dimensions = dimensions;
    this.start = start;
    this.count = count;
  }

  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 uri;
    case 1: return data;
    case 2: return dimensions;
    case 3: return start;
    case 4: return count;
    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: uri = (java.lang.CharSequence)value$; break;
    case 1: data = (Energistics.Datatypes.AnyArray)value$; break;
    case 2: dimensions = (java.lang.Long)value$; break;
    case 3: start = (java.util.List)value$; break;
    case 4: count = (java.util.List)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'uri' field.
   * @return The value of the 'uri' field.
   */
  public java.lang.CharSequence getUri() {
    return uri;
  }

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

  /**
   * Gets the value of the 'data' field.
   * @return The value of the 'data' field.
   */
  public Energistics.Datatypes.AnyArray getData() {
    return data;
  }

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

  /**
   * Gets the value of the 'dimensions' field.
   * @return The value of the 'dimensions' field.
   */
  public java.lang.Long getDimensions() {
    return dimensions;
  }

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

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

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

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

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

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

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

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

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

    private java.lang.CharSequence uri;
    private Energistics.Datatypes.AnyArray data;
    private Energistics.Datatypes.AnyArray.Builder dataBuilder;
    private long dimensions;
    private java.util.List start;
    private java.util.List count;

    /** 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.DataArray.PutDataArraySlice.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.uri)) {
        this.uri = data().deepCopy(fields()[0].schema(), other.uri);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.data)) {
        this.data = data().deepCopy(fields()[1].schema(), other.data);
        fieldSetFlags()[1] = true;
      }
      if (other.hasDataBuilder()) {
        this.dataBuilder = Energistics.Datatypes.AnyArray.newBuilder(other.getDataBuilder());
      }
      if (isValidValue(fields()[2], other.dimensions)) {
        this.dimensions = data().deepCopy(fields()[2].schema(), other.dimensions);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.start)) {
        this.start = data().deepCopy(fields()[3].schema(), other.start);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.count)) {
        this.count = data().deepCopy(fields()[4].schema(), other.count);
        fieldSetFlags()[4] = true;
      }
    }

    /**
     * Creates a Builder by copying an existing PutDataArraySlice instance
     * @param other The existing instance to copy.
     */
    private Builder(Energistics.Protocol.DataArray.PutDataArraySlice other) {
            super(SCHEMA$);
      if (isValidValue(fields()[0], other.uri)) {
        this.uri = data().deepCopy(fields()[0].schema(), other.uri);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.data)) {
        this.data = data().deepCopy(fields()[1].schema(), other.data);
        fieldSetFlags()[1] = true;
      }
      this.dataBuilder = null;
      if (isValidValue(fields()[2], other.dimensions)) {
        this.dimensions = data().deepCopy(fields()[2].schema(), other.dimensions);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.start)) {
        this.start = data().deepCopy(fields()[3].schema(), other.start);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.count)) {
        this.count = data().deepCopy(fields()[4].schema(), other.count);
        fieldSetFlags()[4] = true;
      }
    }

    /**
      * Gets the value of the 'uri' field.
      * @return The value.
      */
    public java.lang.CharSequence getUri() {
      return uri;
    }

    /**
      * Sets the value of the 'uri' field.
      * @param value The value of 'uri'.
      * @return This builder.
      */
    public Energistics.Protocol.DataArray.PutDataArraySlice.Builder setUri(java.lang.CharSequence value) {
      validate(fields()[0], value);
      this.uri = value;
      fieldSetFlags()[0] = true;
      return this;
    }

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


    /**
      * Clears the value of the 'uri' field.
      * @return This builder.
      */
    public Energistics.Protocol.DataArray.PutDataArraySlice.Builder clearUri() {
      uri = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /**
      * Gets the value of the 'data' field.
      * @return The value.
      */
    public Energistics.Datatypes.AnyArray getData() {
      return data;
    }

    /**
      * Sets the value of the 'data' field.
      * @param value The value of 'data'.
      * @return This builder.
      */
    public Energistics.Protocol.DataArray.PutDataArraySlice.Builder setData(Energistics.Datatypes.AnyArray value) {
      validate(fields()[1], value);
      this.dataBuilder = null;
      this.data = value;
      fieldSetFlags()[1] = 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()[1];
    }

    /**
     * Gets the Builder instance for the 'data' field and creates one if it doesn't exist yet.
     * @return This builder.
     */
    public Energistics.Datatypes.AnyArray.Builder getDataBuilder() {
      if (dataBuilder == null) {
        if (hasData()) {
          setDataBuilder(Energistics.Datatypes.AnyArray.newBuilder(data));
        } else {
          setDataBuilder(Energistics.Datatypes.AnyArray.newBuilder());
        }
      }
      return dataBuilder;
    }

    /**
     * Sets the Builder instance for the 'data' field
     * @param value The builder instance that must be set.
     * @return This builder.
     */
    public Energistics.Protocol.DataArray.PutDataArraySlice.Builder setDataBuilder(Energistics.Datatypes.AnyArray.Builder value) {
      clearData();
      dataBuilder = value;
      return this;
    }

    /**
     * Checks whether the 'data' field has an active Builder instance
     * @return True if the 'data' field has an active Builder instance
     */
    public boolean hasDataBuilder() {
      return dataBuilder != null;
    }

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

    /**
      * Gets the value of the 'dimensions' field.
      * @return The value.
      */
    public java.lang.Long getDimensions() {
      return dimensions;
    }

    /**
      * Sets the value of the 'dimensions' field.
      * @param value The value of 'dimensions'.
      * @return This builder.
      */
    public Energistics.Protocol.DataArray.PutDataArraySlice.Builder setDimensions(long value) {
      validate(fields()[2], value);
      this.dimensions = value;
      fieldSetFlags()[2] = 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()[2];
    }


    /**
      * Clears the value of the 'dimensions' field.
      * @return This builder.
      */
    public Energistics.Protocol.DataArray.PutDataArraySlice.Builder clearDimensions() {
      fieldSetFlags()[2] = false;
      return this;
    }

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

    /**
      * Sets the value of the 'start' field.
      * @param value The value of 'start'.
      * @return This builder.
      */
    public Energistics.Protocol.DataArray.PutDataArraySlice.Builder setStart(java.util.List value) {
      validate(fields()[3], value);
      this.start = value;
      fieldSetFlags()[3] = true;
      return this;
    }

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


    /**
      * Clears the value of the 'start' field.
      * @return This builder.
      */
    public Energistics.Protocol.DataArray.PutDataArraySlice.Builder clearStart() {
      start = null;
      fieldSetFlags()[3] = false;
      return this;
    }

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

    /**
      * Sets the value of the 'count' field.
      * @param value The value of 'count'.
      * @return This builder.
      */
    public Energistics.Protocol.DataArray.PutDataArraySlice.Builder setCount(java.util.List value) {
      validate(fields()[4], value);
      this.count = value;
      fieldSetFlags()[4] = true;
      return this;
    }

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


    /**
      * Clears the value of the 'count' field.
      * @return This builder.
      */
    public Energistics.Protocol.DataArray.PutDataArraySlice.Builder clearCount() {
      count = null;
      fieldSetFlags()[4] = false;
      return this;
    }

    @Override
    public PutDataArraySlice build() {
      try {
        PutDataArraySlice record = new PutDataArraySlice();
        record.uri = fieldSetFlags()[0] ? this.uri : (java.lang.CharSequence) defaultValue(fields()[0]);
        if (dataBuilder != null) {
          record.data = this.dataBuilder.build();
        } else {
          record.data = fieldSetFlags()[1] ? this.data : (Energistics.Datatypes.AnyArray) defaultValue(fields()[1]);
        }
        record.dimensions = fieldSetFlags()[2] ? this.dimensions : (java.lang.Long) defaultValue(fields()[2]);
        record.start = fieldSetFlags()[3] ? this.start : (java.util.List) defaultValue(fields()[3]);
        record.count = fieldSetFlags()[4] ? this.count : (java.util.List) defaultValue(fields()[4]);
        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