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/** Cross-language application submission parameters to the Local runtime */
012@org.apache.avro.specific.AvroGenerated
013public class AvroLocalAppSubmissionParameters extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
014  private static final long serialVersionUID = -1652467064570965358L;
015  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"AvroLocalAppSubmissionParameters\",\"namespace\":\"org.apache.reef.reef.bridge.client.avro\",\"doc\":\"Cross-language application submission parameters to the Local runtime\",\"fields\":[{\"name\":\"sharedAppSubmissionParameters\",\"type\":{\"type\":\"record\",\"name\":\"AvroAppSubmissionParameters\",\"doc\":\"General cross-language application submission parameters shared by all runtimes\",\"fields\":[{\"name\":\"tcpBeginPort\",\"type\":\"int\"},{\"name\":\"tcpRangeCount\",\"type\":\"int\"},{\"name\":\"tcpTryCount\",\"type\":\"int\"}]}},{\"name\":\"maxNumberOfConcurrentEvaluators\",\"type\":\"int\"}]}");
016  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
017  @Deprecated public org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters sharedAppSubmissionParameters;
018  @Deprecated public int maxNumberOfConcurrentEvaluators;
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 AvroLocalAppSubmissionParameters() {}
026
027  /**
028   * All-args constructor.
029   * @param sharedAppSubmissionParameters The new value for sharedAppSubmissionParameters
030   * @param maxNumberOfConcurrentEvaluators The new value for maxNumberOfConcurrentEvaluators
031   */
032  public AvroLocalAppSubmissionParameters(org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters sharedAppSubmissionParameters, java.lang.Integer maxNumberOfConcurrentEvaluators) {
033    this.sharedAppSubmissionParameters = sharedAppSubmissionParameters;
034    this.maxNumberOfConcurrentEvaluators = maxNumberOfConcurrentEvaluators;
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 sharedAppSubmissionParameters;
042    case 1: return maxNumberOfConcurrentEvaluators;
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: sharedAppSubmissionParameters = (org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters)value$; break;
052    case 1: maxNumberOfConcurrentEvaluators = (java.lang.Integer)value$; break;
053    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
054    }
055  }
056
057  /**
058   * Gets the value of the 'sharedAppSubmissionParameters' field.
059   * @return The value of the 'sharedAppSubmissionParameters' field.
060   */
061  public org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters getSharedAppSubmissionParameters() {
062    return sharedAppSubmissionParameters;
063  }
064
065  /**
066   * Sets the value of the 'sharedAppSubmissionParameters' field.
067   * @param value the value to set.
068   */
069  public void setSharedAppSubmissionParameters(org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters value) {
070    this.sharedAppSubmissionParameters = value;
071  }
072
073  /**
074   * Gets the value of the 'maxNumberOfConcurrentEvaluators' field.
075   * @return The value of the 'maxNumberOfConcurrentEvaluators' field.
076   */
077  public java.lang.Integer getMaxNumberOfConcurrentEvaluators() {
078    return maxNumberOfConcurrentEvaluators;
079  }
080
081  /**
082   * Sets the value of the 'maxNumberOfConcurrentEvaluators' field.
083   * @param value the value to set.
084   */
085  public void setMaxNumberOfConcurrentEvaluators(java.lang.Integer value) {
086    this.maxNumberOfConcurrentEvaluators = value;
087  }
088
089  /**
090   * Creates a new AvroLocalAppSubmissionParameters RecordBuilder.
091   * @return A new AvroLocalAppSubmissionParameters RecordBuilder
092   */
093  public static org.apache.reef.reef.bridge.client.avro.AvroLocalAppSubmissionParameters.Builder newBuilder() {
094    return new org.apache.reef.reef.bridge.client.avro.AvroLocalAppSubmissionParameters.Builder();
095  }
096
097  /**
098   * Creates a new AvroLocalAppSubmissionParameters RecordBuilder by copying an existing Builder.
099   * @param other The existing builder to copy.
100   * @return A new AvroLocalAppSubmissionParameters RecordBuilder
101   */
102  public static org.apache.reef.reef.bridge.client.avro.AvroLocalAppSubmissionParameters.Builder newBuilder(org.apache.reef.reef.bridge.client.avro.AvroLocalAppSubmissionParameters.Builder other) {
103    return new org.apache.reef.reef.bridge.client.avro.AvroLocalAppSubmissionParameters.Builder(other);
104  }
105
106  /**
107   * Creates a new AvroLocalAppSubmissionParameters RecordBuilder by copying an existing AvroLocalAppSubmissionParameters instance.
108   * @param other The existing instance to copy.
109   * @return A new AvroLocalAppSubmissionParameters RecordBuilder
110   */
111  public static org.apache.reef.reef.bridge.client.avro.AvroLocalAppSubmissionParameters.Builder newBuilder(org.apache.reef.reef.bridge.client.avro.AvroLocalAppSubmissionParameters other) {
112    return new org.apache.reef.reef.bridge.client.avro.AvroLocalAppSubmissionParameters.Builder(other);
113  }
114
115  /**
116   * RecordBuilder for AvroLocalAppSubmissionParameters instances.
117   */
118  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroLocalAppSubmissionParameters>
119    implements org.apache.avro.data.RecordBuilder<AvroLocalAppSubmissionParameters> {
120
121    private org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters sharedAppSubmissionParameters;
122    private org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder sharedAppSubmissionParametersBuilder;
123    private int maxNumberOfConcurrentEvaluators;
124
125    /** Creates a new Builder */
126    private Builder() {
127      super(SCHEMA$);
128    }
129
130    /**
131     * Creates a Builder by copying an existing Builder.
132     * @param other The existing Builder to copy.
133     */
134    private Builder(org.apache.reef.reef.bridge.client.avro.AvroLocalAppSubmissionParameters.Builder other) {
135      super(other);
136      if (isValidValue(fields()[0], other.sharedAppSubmissionParameters)) {
137        this.sharedAppSubmissionParameters = data().deepCopy(fields()[0].schema(), other.sharedAppSubmissionParameters);
138        fieldSetFlags()[0] = true;
139      }
140      if (other.hasSharedAppSubmissionParametersBuilder()) {
141        this.sharedAppSubmissionParametersBuilder = org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.newBuilder(other.getSharedAppSubmissionParametersBuilder());
142      }
143      if (isValidValue(fields()[1], other.maxNumberOfConcurrentEvaluators)) {
144        this.maxNumberOfConcurrentEvaluators = data().deepCopy(fields()[1].schema(), other.maxNumberOfConcurrentEvaluators);
145        fieldSetFlags()[1] = true;
146      }
147    }
148
149    /**
150     * Creates a Builder by copying an existing AvroLocalAppSubmissionParameters instance
151     * @param other The existing instance to copy.
152     */
153    private Builder(org.apache.reef.reef.bridge.client.avro.AvroLocalAppSubmissionParameters other) {
154            super(SCHEMA$);
155      if (isValidValue(fields()[0], other.sharedAppSubmissionParameters)) {
156        this.sharedAppSubmissionParameters = data().deepCopy(fields()[0].schema(), other.sharedAppSubmissionParameters);
157        fieldSetFlags()[0] = true;
158      }
159      this.sharedAppSubmissionParametersBuilder = null;
160      if (isValidValue(fields()[1], other.maxNumberOfConcurrentEvaluators)) {
161        this.maxNumberOfConcurrentEvaluators = data().deepCopy(fields()[1].schema(), other.maxNumberOfConcurrentEvaluators);
162        fieldSetFlags()[1] = true;
163      }
164    }
165
166    /**
167      * Gets the value of the 'sharedAppSubmissionParameters' field.
168      * @return The value.
169      */
170    public org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters getSharedAppSubmissionParameters() {
171      return sharedAppSubmissionParameters;
172    }
173
174    /**
175      * Sets the value of the 'sharedAppSubmissionParameters' field.
176      * @param value The value of 'sharedAppSubmissionParameters'.
177      * @return This builder.
178      */
179    public org.apache.reef.reef.bridge.client.avro.AvroLocalAppSubmissionParameters.Builder setSharedAppSubmissionParameters(org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters value) {
180      validate(fields()[0], value);
181      this.sharedAppSubmissionParametersBuilder = null;
182      this.sharedAppSubmissionParameters = value;
183      fieldSetFlags()[0] = true;
184      return this;
185    }
186
187    /**
188      * Checks whether the 'sharedAppSubmissionParameters' field has been set.
189      * @return True if the 'sharedAppSubmissionParameters' field has been set, false otherwise.
190      */
191    public boolean hasSharedAppSubmissionParameters() {
192      return fieldSetFlags()[0];
193    }
194
195    /**
196     * Gets the Builder instance for the 'sharedAppSubmissionParameters' field and creates one if it doesn't exist yet.
197     * @return This builder.
198     */
199    public org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder getSharedAppSubmissionParametersBuilder() {
200      if (sharedAppSubmissionParametersBuilder == null) {
201        if (hasSharedAppSubmissionParameters()) {
202          setSharedAppSubmissionParametersBuilder(org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.newBuilder(sharedAppSubmissionParameters));
203        } else {
204          setSharedAppSubmissionParametersBuilder(org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.newBuilder());
205        }
206      }
207      return sharedAppSubmissionParametersBuilder;
208    }
209
210    /**
211     * Sets the Builder instance for the 'sharedAppSubmissionParameters' field
212     * @param value The builder instance that must be set.
213     * @return This builder.
214     */
215    public org.apache.reef.reef.bridge.client.avro.AvroLocalAppSubmissionParameters.Builder setSharedAppSubmissionParametersBuilder(org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder value) {
216      clearSharedAppSubmissionParameters();
217      sharedAppSubmissionParametersBuilder = value;
218      return this;
219    }
220
221    /**
222     * Checks whether the 'sharedAppSubmissionParameters' field has an active Builder instance
223     * @return True if the 'sharedAppSubmissionParameters' field has an active Builder instance
224     */
225    public boolean hasSharedAppSubmissionParametersBuilder() {
226      return sharedAppSubmissionParametersBuilder != null;
227    }
228
229    /**
230      * Clears the value of the 'sharedAppSubmissionParameters' field.
231      * @return This builder.
232      */
233    public org.apache.reef.reef.bridge.client.avro.AvroLocalAppSubmissionParameters.Builder clearSharedAppSubmissionParameters() {
234      sharedAppSubmissionParameters = null;
235      sharedAppSubmissionParametersBuilder = null;
236      fieldSetFlags()[0] = false;
237      return this;
238    }
239
240    /**
241      * Gets the value of the 'maxNumberOfConcurrentEvaluators' field.
242      * @return The value.
243      */
244    public java.lang.Integer getMaxNumberOfConcurrentEvaluators() {
245      return maxNumberOfConcurrentEvaluators;
246    }
247
248    /**
249      * Sets the value of the 'maxNumberOfConcurrentEvaluators' field.
250      * @param value The value of 'maxNumberOfConcurrentEvaluators'.
251      * @return This builder.
252      */
253    public org.apache.reef.reef.bridge.client.avro.AvroLocalAppSubmissionParameters.Builder setMaxNumberOfConcurrentEvaluators(int value) {
254      validate(fields()[1], value);
255      this.maxNumberOfConcurrentEvaluators = value;
256      fieldSetFlags()[1] = true;
257      return this;
258    }
259
260    /**
261      * Checks whether the 'maxNumberOfConcurrentEvaluators' field has been set.
262      * @return True if the 'maxNumberOfConcurrentEvaluators' field has been set, false otherwise.
263      */
264    public boolean hasMaxNumberOfConcurrentEvaluators() {
265      return fieldSetFlags()[1];
266    }
267
268
269    /**
270      * Clears the value of the 'maxNumberOfConcurrentEvaluators' field.
271      * @return This builder.
272      */
273    public org.apache.reef.reef.bridge.client.avro.AvroLocalAppSubmissionParameters.Builder clearMaxNumberOfConcurrentEvaluators() {
274      fieldSetFlags()[1] = false;
275      return this;
276    }
277
278    @Override
279    public AvroLocalAppSubmissionParameters build() {
280      try {
281        AvroLocalAppSubmissionParameters record = new AvroLocalAppSubmissionParameters();
282        if (sharedAppSubmissionParametersBuilder != null) {
283          record.sharedAppSubmissionParameters = this.sharedAppSubmissionParametersBuilder.build();
284        } else {
285          record.sharedAppSubmissionParameters = fieldSetFlags()[0] ? this.sharedAppSubmissionParameters : (org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters) defaultValue(fields()[0]);
286        }
287        record.maxNumberOfConcurrentEvaluators = fieldSetFlags()[1] ? this.maxNumberOfConcurrentEvaluators : (java.lang.Integer) defaultValue(fields()[1]);
288        return record;
289      } catch (Exception e) {
290        throw new org.apache.avro.AvroRuntimeException(e);
291      }
292    }
293  }
294
295  private static final org.apache.avro.io.DatumWriter
296    WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);
297
298  @Override public void writeExternal(java.io.ObjectOutput out)
299    throws java.io.IOException {
300    WRITER$.write(this, SpecificData.getEncoder(out));
301  }
302
303  private static final org.apache.avro.io.DatumReader
304    READER$ = new org.apache.avro.specific.SpecificDatumReader(SCHEMA$);
305
306  @Override public void readExternal(java.io.ObjectInput in)
307    throws java.io.IOException {
308    READER$.read(this, SpecificData.getDecoder(in));
309  }
310
311}