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