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.webserver;  
007@SuppressWarnings("all")
008@org.apache.avro.specific.AvroGenerated
009public class AvroEvaluatorList extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
010  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\"}]}");
011  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
012  @Deprecated public java.util.List<org.apache.reef.webserver.AvroEvaluatorEntry> evaluators;
013  @Deprecated public int total;
014  @Deprecated public java.lang.CharSequence startTime;
015
016  /**
017   * Default constructor.  Note that this does not initialize fields
018   * to their default values from the schema.  If that is desired then
019   * one should use <code>newBuilder()</code>. 
020   */
021  public AvroEvaluatorList() {}
022
023  /**
024   * All-args constructor.
025   */
026  public AvroEvaluatorList(java.util.List<org.apache.reef.webserver.AvroEvaluatorEntry> evaluators, java.lang.Integer total, java.lang.CharSequence startTime) {
027    this.evaluators = evaluators;
028    this.total = total;
029    this.startTime = startTime;
030  }
031
032  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
033  // Used by DatumWriter.  Applications should not call. 
034  public java.lang.Object get(int field$) {
035    switch (field$) {
036    case 0: return evaluators;
037    case 1: return total;
038    case 2: return startTime;
039    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
040    }
041  }
042  // Used by DatumReader.  Applications should not call. 
043  @SuppressWarnings(value="unchecked")
044  public void put(int field$, java.lang.Object value$) {
045    switch (field$) {
046    case 0: evaluators = (java.util.List<org.apache.reef.webserver.AvroEvaluatorEntry>)value$; break;
047    case 1: total = (java.lang.Integer)value$; break;
048    case 2: startTime = (java.lang.CharSequence)value$; break;
049    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
050    }
051  }
052
053  /**
054   * Gets the value of the 'evaluators' field.
055   */
056  public java.util.List<org.apache.reef.webserver.AvroEvaluatorEntry> getEvaluators() {
057    return evaluators;
058  }
059
060  /**
061   * Sets the value of the 'evaluators' field.
062   * @param value the value to set.
063   */
064  public void setEvaluators(java.util.List<org.apache.reef.webserver.AvroEvaluatorEntry> value) {
065    this.evaluators = value;
066  }
067
068  /**
069   * Gets the value of the 'total' field.
070   */
071  public java.lang.Integer getTotal() {
072    return total;
073  }
074
075  /**
076   * Sets the value of the 'total' field.
077   * @param value the value to set.
078   */
079  public void setTotal(java.lang.Integer value) {
080    this.total = value;
081  }
082
083  /**
084   * Gets the value of the 'startTime' field.
085   */
086  public java.lang.CharSequence getStartTime() {
087    return startTime;
088  }
089
090  /**
091   * Sets the value of the 'startTime' field.
092   * @param value the value to set.
093   */
094  public void setStartTime(java.lang.CharSequence value) {
095    this.startTime = value;
096  }
097
098  /** Creates a new AvroEvaluatorList RecordBuilder */
099  public static org.apache.reef.webserver.AvroEvaluatorList.Builder newBuilder() {
100    return new org.apache.reef.webserver.AvroEvaluatorList.Builder();
101  }
102  
103  /** Creates a new AvroEvaluatorList RecordBuilder by copying an existing Builder */
104  public static org.apache.reef.webserver.AvroEvaluatorList.Builder newBuilder(org.apache.reef.webserver.AvroEvaluatorList.Builder other) {
105    return new org.apache.reef.webserver.AvroEvaluatorList.Builder(other);
106  }
107  
108  /** Creates a new AvroEvaluatorList RecordBuilder by copying an existing AvroEvaluatorList instance */
109  public static org.apache.reef.webserver.AvroEvaluatorList.Builder newBuilder(org.apache.reef.webserver.AvroEvaluatorList other) {
110    return new org.apache.reef.webserver.AvroEvaluatorList.Builder(other);
111  }
112  
113  /**
114   * RecordBuilder for AvroEvaluatorList instances.
115   */
116  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroEvaluatorList>
117    implements org.apache.avro.data.RecordBuilder<AvroEvaluatorList> {
118
119    private java.util.List<org.apache.reef.webserver.AvroEvaluatorEntry> evaluators;
120    private int total;
121    private java.lang.CharSequence startTime;
122
123    /** Creates a new Builder */
124    private Builder() {
125      super(org.apache.reef.webserver.AvroEvaluatorList.SCHEMA$);
126    }
127    
128    /** Creates a Builder by copying an existing Builder */
129    private Builder(org.apache.reef.webserver.AvroEvaluatorList.Builder other) {
130      super(other);
131      if (isValidValue(fields()[0], other.evaluators)) {
132        this.evaluators = data().deepCopy(fields()[0].schema(), other.evaluators);
133        fieldSetFlags()[0] = true;
134      }
135      if (isValidValue(fields()[1], other.total)) {
136        this.total = data().deepCopy(fields()[1].schema(), other.total);
137        fieldSetFlags()[1] = true;
138      }
139      if (isValidValue(fields()[2], other.startTime)) {
140        this.startTime = data().deepCopy(fields()[2].schema(), other.startTime);
141        fieldSetFlags()[2] = true;
142      }
143    }
144    
145    /** Creates a Builder by copying an existing AvroEvaluatorList instance */
146    private Builder(org.apache.reef.webserver.AvroEvaluatorList other) {
147            super(org.apache.reef.webserver.AvroEvaluatorList.SCHEMA$);
148      if (isValidValue(fields()[0], other.evaluators)) {
149        this.evaluators = data().deepCopy(fields()[0].schema(), other.evaluators);
150        fieldSetFlags()[0] = true;
151      }
152      if (isValidValue(fields()[1], other.total)) {
153        this.total = data().deepCopy(fields()[1].schema(), other.total);
154        fieldSetFlags()[1] = true;
155      }
156      if (isValidValue(fields()[2], other.startTime)) {
157        this.startTime = data().deepCopy(fields()[2].schema(), other.startTime);
158        fieldSetFlags()[2] = true;
159      }
160    }
161
162    /** Gets the value of the 'evaluators' field */
163    public java.util.List<org.apache.reef.webserver.AvroEvaluatorEntry> getEvaluators() {
164      return evaluators;
165    }
166    
167    /** Sets the value of the 'evaluators' field */
168    public org.apache.reef.webserver.AvroEvaluatorList.Builder setEvaluators(java.util.List<org.apache.reef.webserver.AvroEvaluatorEntry> value) {
169      validate(fields()[0], value);
170      this.evaluators = value;
171      fieldSetFlags()[0] = true;
172      return this; 
173    }
174    
175    /** Checks whether the 'evaluators' field has been set */
176    public boolean hasEvaluators() {
177      return fieldSetFlags()[0];
178    }
179    
180    /** Clears the value of the 'evaluators' field */
181    public org.apache.reef.webserver.AvroEvaluatorList.Builder clearEvaluators() {
182      evaluators = null;
183      fieldSetFlags()[0] = false;
184      return this;
185    }
186
187    /** Gets the value of the 'total' field */
188    public java.lang.Integer getTotal() {
189      return total;
190    }
191    
192    /** Sets the value of the 'total' field */
193    public org.apache.reef.webserver.AvroEvaluatorList.Builder setTotal(int value) {
194      validate(fields()[1], value);
195      this.total = value;
196      fieldSetFlags()[1] = true;
197      return this; 
198    }
199    
200    /** Checks whether the 'total' field has been set */
201    public boolean hasTotal() {
202      return fieldSetFlags()[1];
203    }
204    
205    /** Clears the value of the 'total' field */
206    public org.apache.reef.webserver.AvroEvaluatorList.Builder clearTotal() {
207      fieldSetFlags()[1] = false;
208      return this;
209    }
210
211    /** Gets the value of the 'startTime' field */
212    public java.lang.CharSequence getStartTime() {
213      return startTime;
214    }
215    
216    /** Sets the value of the 'startTime' field */
217    public org.apache.reef.webserver.AvroEvaluatorList.Builder setStartTime(java.lang.CharSequence value) {
218      validate(fields()[2], value);
219      this.startTime = value;
220      fieldSetFlags()[2] = true;
221      return this; 
222    }
223    
224    /** Checks whether the 'startTime' field has been set */
225    public boolean hasStartTime() {
226      return fieldSetFlags()[2];
227    }
228    
229    /** Clears the value of the 'startTime' field */
230    public org.apache.reef.webserver.AvroEvaluatorList.Builder clearStartTime() {
231      startTime = null;
232      fieldSetFlags()[2] = false;
233      return this;
234    }
235
236    @Override
237    public AvroEvaluatorList build() {
238      try {
239        AvroEvaluatorList record = new AvroEvaluatorList();
240        record.evaluators = fieldSetFlags()[0] ? this.evaluators : (java.util.List<org.apache.reef.webserver.AvroEvaluatorEntry>) defaultValue(fields()[0]);
241        record.total = fieldSetFlags()[1] ? this.total : (java.lang.Integer) defaultValue(fields()[1]);
242        record.startTime = fieldSetFlags()[2] ? this.startTime : (java.lang.CharSequence) defaultValue(fields()[2]);
243        return record;
244      } catch (Exception e) {
245        throw new org.apache.avro.AvroRuntimeException(e);
246      }
247    }
248  }
249}