001/**
002 * Autogenerated by Avro
003 *
004 * DO NOT EDIT DIRECTLY
005 */
006package org.apache.reef.reef.bridge.client.avro;
007
008import org.apache.avro.specific.SpecificData;
009
010@SuppressWarnings("all")
011/** General cross-language job submission parameters shared by all runtimes */
012@org.apache.avro.specific.AvroGenerated
013public class AvroJobSubmissionParameters extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
014  private static final long serialVersionUID = 6784729106931925305L;
015  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"AvroJobSubmissionParameters\",\"namespace\":\"org.apache.reef.reef.bridge.client.avro\",\"doc\":\"General cross-language job submission parameters shared by all runtimes\",\"fields\":[{\"name\":\"jobId\",\"type\":\"string\"},{\"name\":\"jobSubmissionFolder\",\"type\":\"string\"}]}");
016  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
017  @Deprecated public java.lang.CharSequence jobId;
018  @Deprecated public java.lang.CharSequence jobSubmissionFolder;
019
020  /**
021   * Default constructor.  Note that this does not initialize fields
022   * to their default values from the schema.  If that is desired then
023   * one should use <code>newBuilder()</code>.
024   */
025  public AvroJobSubmissionParameters() {}
026
027  /**
028   * All-args constructor.
029   * @param jobId The new value for jobId
030   * @param jobSubmissionFolder The new value for jobSubmissionFolder
031   */
032  public AvroJobSubmissionParameters(java.lang.CharSequence jobId, java.lang.CharSequence jobSubmissionFolder) {
033    this.jobId = jobId;
034    this.jobSubmissionFolder = jobSubmissionFolder;
035  }
036
037  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
038  // Used by DatumWriter.  Applications should not call.
039  public java.lang.Object get(int field$) {
040    switch (field$) {
041    case 0: return jobId;
042    case 1: return jobSubmissionFolder;
043    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
044    }
045  }
046
047  // Used by DatumReader.  Applications should not call.
048  @SuppressWarnings(value="unchecked")
049  public void put(int field$, java.lang.Object value$) {
050    switch (field$) {
051    case 0: jobId = (java.lang.CharSequence)value$; break;
052    case 1: jobSubmissionFolder = (java.lang.CharSequence)value$; break;
053    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
054    }
055  }
056
057  /**
058   * Gets the value of the 'jobId' field.
059   * @return The value of the 'jobId' field.
060   */
061  public java.lang.CharSequence getJobId() {
062    return jobId;
063  }
064
065  /**
066   * Sets the value of the 'jobId' field.
067   * @param value the value to set.
068   */
069  public void setJobId(java.lang.CharSequence value) {
070    this.jobId = value;
071  }
072
073  /**
074   * Gets the value of the 'jobSubmissionFolder' field.
075   * @return The value of the 'jobSubmissionFolder' field.
076   */
077  public java.lang.CharSequence getJobSubmissionFolder() {
078    return jobSubmissionFolder;
079  }
080
081  /**
082   * Sets the value of the 'jobSubmissionFolder' field.
083   * @param value the value to set.
084   */
085  public void setJobSubmissionFolder(java.lang.CharSequence value) {
086    this.jobSubmissionFolder = value;
087  }
088
089  /**
090   * Creates a new AvroJobSubmissionParameters RecordBuilder.
091   * @return A new AvroJobSubmissionParameters RecordBuilder
092   */
093  public static org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.Builder newBuilder() {
094    return new org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.Builder();
095  }
096
097  /**
098   * Creates a new AvroJobSubmissionParameters RecordBuilder by copying an existing Builder.
099   * @param other The existing builder to copy.
100   * @return A new AvroJobSubmissionParameters RecordBuilder
101   */
102  public static org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.Builder newBuilder(org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.Builder other) {
103    return new org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.Builder(other);
104  }
105
106  /**
107   * Creates a new AvroJobSubmissionParameters RecordBuilder by copying an existing AvroJobSubmissionParameters instance.
108   * @param other The existing instance to copy.
109   * @return A new AvroJobSubmissionParameters RecordBuilder
110   */
111  public static org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.Builder newBuilder(org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters other) {
112    return new org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.Builder(other);
113  }
114
115  /**
116   * RecordBuilder for AvroJobSubmissionParameters instances.
117   */
118  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroJobSubmissionParameters>
119    implements org.apache.avro.data.RecordBuilder<AvroJobSubmissionParameters> {
120
121    private java.lang.CharSequence jobId;
122    private java.lang.CharSequence jobSubmissionFolder;
123
124    /** Creates a new Builder */
125    private Builder() {
126      super(SCHEMA$);
127    }
128
129    /**
130     * Creates a Builder by copying an existing Builder.
131     * @param other The existing Builder to copy.
132     */
133    private Builder(org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.Builder other) {
134      super(other);
135      if (isValidValue(fields()[0], other.jobId)) {
136        this.jobId = data().deepCopy(fields()[0].schema(), other.jobId);
137        fieldSetFlags()[0] = true;
138      }
139      if (isValidValue(fields()[1], other.jobSubmissionFolder)) {
140        this.jobSubmissionFolder = data().deepCopy(fields()[1].schema(), other.jobSubmissionFolder);
141        fieldSetFlags()[1] = true;
142      }
143    }
144
145    /**
146     * Creates a Builder by copying an existing AvroJobSubmissionParameters instance
147     * @param other The existing instance to copy.
148     */
149    private Builder(org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters other) {
150            super(SCHEMA$);
151      if (isValidValue(fields()[0], other.jobId)) {
152        this.jobId = data().deepCopy(fields()[0].schema(), other.jobId);
153        fieldSetFlags()[0] = true;
154      }
155      if (isValidValue(fields()[1], other.jobSubmissionFolder)) {
156        this.jobSubmissionFolder = data().deepCopy(fields()[1].schema(), other.jobSubmissionFolder);
157        fieldSetFlags()[1] = true;
158      }
159    }
160
161    /**
162      * Gets the value of the 'jobId' field.
163      * @return The value.
164      */
165    public java.lang.CharSequence getJobId() {
166      return jobId;
167    }
168
169    /**
170      * Sets the value of the 'jobId' field.
171      * @param value The value of 'jobId'.
172      * @return This builder.
173      */
174    public org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.Builder setJobId(java.lang.CharSequence value) {
175      validate(fields()[0], value);
176      this.jobId = value;
177      fieldSetFlags()[0] = true;
178      return this;
179    }
180
181    /**
182      * Checks whether the 'jobId' field has been set.
183      * @return True if the 'jobId' field has been set, false otherwise.
184      */
185    public boolean hasJobId() {
186      return fieldSetFlags()[0];
187    }
188
189
190    /**
191      * Clears the value of the 'jobId' field.
192      * @return This builder.
193      */
194    public org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.Builder clearJobId() {
195      jobId = null;
196      fieldSetFlags()[0] = false;
197      return this;
198    }
199
200    /**
201      * Gets the value of the 'jobSubmissionFolder' field.
202      * @return The value.
203      */
204    public java.lang.CharSequence getJobSubmissionFolder() {
205      return jobSubmissionFolder;
206    }
207
208    /**
209      * Sets the value of the 'jobSubmissionFolder' field.
210      * @param value The value of 'jobSubmissionFolder'.
211      * @return This builder.
212      */
213    public org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.Builder setJobSubmissionFolder(java.lang.CharSequence value) {
214      validate(fields()[1], value);
215      this.jobSubmissionFolder = value;
216      fieldSetFlags()[1] = true;
217      return this;
218    }
219
220    /**
221      * Checks whether the 'jobSubmissionFolder' field has been set.
222      * @return True if the 'jobSubmissionFolder' field has been set, false otherwise.
223      */
224    public boolean hasJobSubmissionFolder() {
225      return fieldSetFlags()[1];
226    }
227
228
229    /**
230      * Clears the value of the 'jobSubmissionFolder' field.
231      * @return This builder.
232      */
233    public org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.Builder clearJobSubmissionFolder() {
234      jobSubmissionFolder = null;
235      fieldSetFlags()[1] = false;
236      return this;
237    }
238
239    @Override
240    public AvroJobSubmissionParameters build() {
241      try {
242        AvroJobSubmissionParameters record = new AvroJobSubmissionParameters();
243        record.jobId = fieldSetFlags()[0] ? this.jobId : (java.lang.CharSequence) defaultValue(fields()[0]);
244        record.jobSubmissionFolder = fieldSetFlags()[1] ? this.jobSubmissionFolder : (java.lang.CharSequence) defaultValue(fields()[1]);
245        return record;
246      } catch (Exception e) {
247        throw new org.apache.avro.AvroRuntimeException(e);
248      }
249    }
250  }
251
252  private static final org.apache.avro.io.DatumWriter
253    WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);
254
255  @Override public void writeExternal(java.io.ObjectOutput out)
256    throws java.io.IOException {
257    WRITER$.write(this, SpecificData.getEncoder(out));
258  }
259
260  private static final org.apache.avro.io.DatumReader
261    READER$ = new org.apache.avro.specific.SpecificDatumReader(SCHEMA$);
262
263  @Override public void readExternal(java.io.ObjectInput in)
264    throws java.io.IOException {
265    READER$.read(this, SpecificData.getDecoder(in));
266  }
267
268}