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