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