This project has retired. For details please refer to its Attic page.
Source code
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 application submission parameters shared by all runtimes */
012@org.apache.avro.specific.AvroGenerated
013public class AvroAppSubmissionParameters extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
014  private static final long serialVersionUID = 6226120013061148611L;
015  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"AvroAppSubmissionParameters\",\"namespace\":\"org.apache.reef.reef.bridge.client.avro\",\"doc\":\"General cross-language application submission parameters shared by all runtimes\",\"fields\":[{\"name\":\"tcpBeginPort\",\"type\":\"int\"},{\"name\":\"tcpRangeCount\",\"type\":\"int\"},{\"name\":\"tcpTryCount\",\"type\":\"int\"}]}");
016  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
017  @Deprecated public int tcpBeginPort;
018  @Deprecated public int tcpRangeCount;
019  @Deprecated public int tcpTryCount;
020
021  /**
022   * Default constructor.  Note that this does not initialize fields
023   * to their default values from the schema.  If that is desired then
024   * one should use <code>newBuilder()</code>.
025   */
026  public AvroAppSubmissionParameters() {}
027
028  /**
029   * All-args constructor.
030   * @param tcpBeginPort The new value for tcpBeginPort
031   * @param tcpRangeCount The new value for tcpRangeCount
032   * @param tcpTryCount The new value for tcpTryCount
033   */
034  public AvroAppSubmissionParameters(java.lang.Integer tcpBeginPort, java.lang.Integer tcpRangeCount, java.lang.Integer tcpTryCount) {
035    this.tcpBeginPort = tcpBeginPort;
036    this.tcpRangeCount = tcpRangeCount;
037    this.tcpTryCount = tcpTryCount;
038  }
039
040  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
041  // Used by DatumWriter.  Applications should not call.
042  public java.lang.Object get(int field$) {
043    switch (field$) {
044    case 0: return tcpBeginPort;
045    case 1: return tcpRangeCount;
046    case 2: return tcpTryCount;
047    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
048    }
049  }
050
051  // Used by DatumReader.  Applications should not call.
052  @SuppressWarnings(value="unchecked")
053  public void put(int field$, java.lang.Object value$) {
054    switch (field$) {
055    case 0: tcpBeginPort = (java.lang.Integer)value$; break;
056    case 1: tcpRangeCount = (java.lang.Integer)value$; break;
057    case 2: tcpTryCount = (java.lang.Integer)value$; break;
058    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
059    }
060  }
061
062  /**
063   * Gets the value of the 'tcpBeginPort' field.
064   * @return The value of the 'tcpBeginPort' field.
065   */
066  public java.lang.Integer getTcpBeginPort() {
067    return tcpBeginPort;
068  }
069
070  /**
071   * Sets the value of the 'tcpBeginPort' field.
072   * @param value the value to set.
073   */
074  public void setTcpBeginPort(java.lang.Integer value) {
075    this.tcpBeginPort = value;
076  }
077
078  /**
079   * Gets the value of the 'tcpRangeCount' field.
080   * @return The value of the 'tcpRangeCount' field.
081   */
082  public java.lang.Integer getTcpRangeCount() {
083    return tcpRangeCount;
084  }
085
086  /**
087   * Sets the value of the 'tcpRangeCount' field.
088   * @param value the value to set.
089   */
090  public void setTcpRangeCount(java.lang.Integer value) {
091    this.tcpRangeCount = value;
092  }
093
094  /**
095   * Gets the value of the 'tcpTryCount' field.
096   * @return The value of the 'tcpTryCount' field.
097   */
098  public java.lang.Integer getTcpTryCount() {
099    return tcpTryCount;
100  }
101
102  /**
103   * Sets the value of the 'tcpTryCount' field.
104   * @param value the value to set.
105   */
106  public void setTcpTryCount(java.lang.Integer value) {
107    this.tcpTryCount = value;
108  }
109
110  /**
111   * Creates a new AvroAppSubmissionParameters RecordBuilder.
112   * @return A new AvroAppSubmissionParameters RecordBuilder
113   */
114  public static org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder newBuilder() {
115    return new org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder();
116  }
117
118  /**
119   * Creates a new AvroAppSubmissionParameters RecordBuilder by copying an existing Builder.
120   * @param other The existing builder to copy.
121   * @return A new AvroAppSubmissionParameters RecordBuilder
122   */
123  public static org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder newBuilder(org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder other) {
124    return new org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder(other);
125  }
126
127  /**
128   * Creates a new AvroAppSubmissionParameters RecordBuilder by copying an existing AvroAppSubmissionParameters instance.
129   * @param other The existing instance to copy.
130   * @return A new AvroAppSubmissionParameters RecordBuilder
131   */
132  public static org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder newBuilder(org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters other) {
133    return new org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder(other);
134  }
135
136  /**
137   * RecordBuilder for AvroAppSubmissionParameters instances.
138   */
139  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroAppSubmissionParameters>
140    implements org.apache.avro.data.RecordBuilder<AvroAppSubmissionParameters> {
141
142    private int tcpBeginPort;
143    private int tcpRangeCount;
144    private int tcpTryCount;
145
146    /** Creates a new Builder */
147    private Builder() {
148      super(SCHEMA$);
149    }
150
151    /**
152     * Creates a Builder by copying an existing Builder.
153     * @param other The existing Builder to copy.
154     */
155    private Builder(org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder other) {
156      super(other);
157      if (isValidValue(fields()[0], other.tcpBeginPort)) {
158        this.tcpBeginPort = data().deepCopy(fields()[0].schema(), other.tcpBeginPort);
159        fieldSetFlags()[0] = true;
160      }
161      if (isValidValue(fields()[1], other.tcpRangeCount)) {
162        this.tcpRangeCount = data().deepCopy(fields()[1].schema(), other.tcpRangeCount);
163        fieldSetFlags()[1] = true;
164      }
165      if (isValidValue(fields()[2], other.tcpTryCount)) {
166        this.tcpTryCount = data().deepCopy(fields()[2].schema(), other.tcpTryCount);
167        fieldSetFlags()[2] = true;
168      }
169    }
170
171    /**
172     * Creates a Builder by copying an existing AvroAppSubmissionParameters instance
173     * @param other The existing instance to copy.
174     */
175    private Builder(org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters other) {
176            super(SCHEMA$);
177      if (isValidValue(fields()[0], other.tcpBeginPort)) {
178        this.tcpBeginPort = data().deepCopy(fields()[0].schema(), other.tcpBeginPort);
179        fieldSetFlags()[0] = true;
180      }
181      if (isValidValue(fields()[1], other.tcpRangeCount)) {
182        this.tcpRangeCount = data().deepCopy(fields()[1].schema(), other.tcpRangeCount);
183        fieldSetFlags()[1] = true;
184      }
185      if (isValidValue(fields()[2], other.tcpTryCount)) {
186        this.tcpTryCount = data().deepCopy(fields()[2].schema(), other.tcpTryCount);
187        fieldSetFlags()[2] = true;
188      }
189    }
190
191    /**
192      * Gets the value of the 'tcpBeginPort' field.
193      * @return The value.
194      */
195    public java.lang.Integer getTcpBeginPort() {
196      return tcpBeginPort;
197    }
198
199    /**
200      * Sets the value of the 'tcpBeginPort' field.
201      * @param value The value of 'tcpBeginPort'.
202      * @return This builder.
203      */
204    public org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder setTcpBeginPort(int value) {
205      validate(fields()[0], value);
206      this.tcpBeginPort = value;
207      fieldSetFlags()[0] = true;
208      return this;
209    }
210
211    /**
212      * Checks whether the 'tcpBeginPort' field has been set.
213      * @return True if the 'tcpBeginPort' field has been set, false otherwise.
214      */
215    public boolean hasTcpBeginPort() {
216      return fieldSetFlags()[0];
217    }
218
219
220    /**
221      * Clears the value of the 'tcpBeginPort' field.
222      * @return This builder.
223      */
224    public org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder clearTcpBeginPort() {
225      fieldSetFlags()[0] = false;
226      return this;
227    }
228
229    /**
230      * Gets the value of the 'tcpRangeCount' field.
231      * @return The value.
232      */
233    public java.lang.Integer getTcpRangeCount() {
234      return tcpRangeCount;
235    }
236
237    /**
238      * Sets the value of the 'tcpRangeCount' field.
239      * @param value The value of 'tcpRangeCount'.
240      * @return This builder.
241      */
242    public org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder setTcpRangeCount(int value) {
243      validate(fields()[1], value);
244      this.tcpRangeCount = value;
245      fieldSetFlags()[1] = true;
246      return this;
247    }
248
249    /**
250      * Checks whether the 'tcpRangeCount' field has been set.
251      * @return True if the 'tcpRangeCount' field has been set, false otherwise.
252      */
253    public boolean hasTcpRangeCount() {
254      return fieldSetFlags()[1];
255    }
256
257
258    /**
259      * Clears the value of the 'tcpRangeCount' field.
260      * @return This builder.
261      */
262    public org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder clearTcpRangeCount() {
263      fieldSetFlags()[1] = false;
264      return this;
265    }
266
267    /**
268      * Gets the value of the 'tcpTryCount' field.
269      * @return The value.
270      */
271    public java.lang.Integer getTcpTryCount() {
272      return tcpTryCount;
273    }
274
275    /**
276      * Sets the value of the 'tcpTryCount' field.
277      * @param value The value of 'tcpTryCount'.
278      * @return This builder.
279      */
280    public org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder setTcpTryCount(int value) {
281      validate(fields()[2], value);
282      this.tcpTryCount = value;
283      fieldSetFlags()[2] = true;
284      return this;
285    }
286
287    /**
288      * Checks whether the 'tcpTryCount' field has been set.
289      * @return True if the 'tcpTryCount' field has been set, false otherwise.
290      */
291    public boolean hasTcpTryCount() {
292      return fieldSetFlags()[2];
293    }
294
295
296    /**
297      * Clears the value of the 'tcpTryCount' field.
298      * @return This builder.
299      */
300    public org.apache.reef.reef.bridge.client.avro.AvroAppSubmissionParameters.Builder clearTcpTryCount() {
301      fieldSetFlags()[2] = false;
302      return this;
303    }
304
305    @Override
306    public AvroAppSubmissionParameters build() {
307      try {
308        AvroAppSubmissionParameters record = new AvroAppSubmissionParameters();
309        record.tcpBeginPort = fieldSetFlags()[0] ? this.tcpBeginPort : (java.lang.Integer) defaultValue(fields()[0]);
310        record.tcpRangeCount = fieldSetFlags()[1] ? this.tcpRangeCount : (java.lang.Integer) defaultValue(fields()[1]);
311        record.tcpTryCount = fieldSetFlags()[2] ? this.tcpTryCount : (java.lang.Integer) defaultValue(fields()[2]);
312        return record;
313      } catch (Exception e) {
314        throw new org.apache.avro.AvroRuntimeException(e);
315      }
316    }
317  }
318
319  private static final org.apache.avro.io.DatumWriter
320    WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);
321
322  @Override public void writeExternal(java.io.ObjectOutput out)
323    throws java.io.IOException {
324    WRITER$.write(this, SpecificData.getEncoder(out));
325  }
326
327  private static final org.apache.avro.io.DatumReader
328    READER$ = new org.apache.avro.specific.SpecificDatumReader(SCHEMA$);
329
330  @Override public void readExternal(java.io.ObjectInput in)
331    throws java.io.IOException {
332    READER$.read(this, SpecificData.getDecoder(in));
333  }
334
335}