001/**
002 * Autogenerated by Avro
003 * 
004 * DO NOT EDIT DIRECTLY
005 */
006package org.apache.reef.tang.implementation.avro;  
007@SuppressWarnings("all")
008@org.apache.avro.specific.AvroGenerated
009public class AvroClassNode 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\":\"AvroClassNode\",\"namespace\":\"org.apache.reef.tang.implementation.avro\",\"fields\":[{\"name\":\"isInjectionCandidate\",\"type\":\"boolean\"},{\"name\":\"isExternalConstructor\",\"type\":\"boolean\"},{\"name\":\"isUnit\",\"type\":\"boolean\"},{\"name\":\"injectableConstructors\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"AvroConstructorDef\",\"fields\":[{\"name\":\"fullClassName\",\"type\":\"string\"},{\"name\":\"constructorArgs\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"AvroConstructorArg\",\"fields\":[{\"name\":\"fullArgClassName\",\"type\":\"string\"},{\"name\":\"namedParameterName\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"isInjectionFuture\",\"type\":\"boolean\"}]}}}]}}},{\"name\":\"otherConstructors\",\"type\":{\"type\":\"array\",\"items\":\"AvroConstructorDef\"}},{\"name\":\"implFullNames\",\"type\":{\"type\":\"array\",\"items\":\"string\"}},{\"name\":\"defaultImplementation\",\"type\":[\"null\",\"string\"],\"default\":null}]}");
011  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
012  @Deprecated public boolean isInjectionCandidate;
013  @Deprecated public boolean isExternalConstructor;
014  @Deprecated public boolean isUnit;
015  @Deprecated public java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef> injectableConstructors;
016  @Deprecated public java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef> otherConstructors;
017  @Deprecated public java.util.List<java.lang.CharSequence> implFullNames;
018  @Deprecated public java.lang.CharSequence defaultImplementation;
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 AvroClassNode() {}
026
027  /**
028   * All-args constructor.
029   */
030  public AvroClassNode(java.lang.Boolean isInjectionCandidate, java.lang.Boolean isExternalConstructor, java.lang.Boolean isUnit, java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef> injectableConstructors, java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef> otherConstructors, java.util.List<java.lang.CharSequence> implFullNames, java.lang.CharSequence defaultImplementation) {
031    this.isInjectionCandidate = isInjectionCandidate;
032    this.isExternalConstructor = isExternalConstructor;
033    this.isUnit = isUnit;
034    this.injectableConstructors = injectableConstructors;
035    this.otherConstructors = otherConstructors;
036    this.implFullNames = implFullNames;
037    this.defaultImplementation = defaultImplementation;
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 isInjectionCandidate;
045    case 1: return isExternalConstructor;
046    case 2: return isUnit;
047    case 3: return injectableConstructors;
048    case 4: return otherConstructors;
049    case 5: return implFullNames;
050    case 6: return defaultImplementation;
051    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
052    }
053  }
054  // Used by DatumReader.  Applications should not call. 
055  @SuppressWarnings(value="unchecked")
056  public void put(int field$, java.lang.Object value$) {
057    switch (field$) {
058    case 0: isInjectionCandidate = (java.lang.Boolean)value$; break;
059    case 1: isExternalConstructor = (java.lang.Boolean)value$; break;
060    case 2: isUnit = (java.lang.Boolean)value$; break;
061    case 3: injectableConstructors = (java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef>)value$; break;
062    case 4: otherConstructors = (java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef>)value$; break;
063    case 5: implFullNames = (java.util.List<java.lang.CharSequence>)value$; break;
064    case 6: defaultImplementation = (java.lang.CharSequence)value$; break;
065    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
066    }
067  }
068
069  /**
070   * Gets the value of the 'isInjectionCandidate' field.
071   */
072  public java.lang.Boolean getIsInjectionCandidate() {
073    return isInjectionCandidate;
074  }
075
076  /**
077   * Sets the value of the 'isInjectionCandidate' field.
078   * @param value the value to set.
079   */
080  public void setIsInjectionCandidate(java.lang.Boolean value) {
081    this.isInjectionCandidate = value;
082  }
083
084  /**
085   * Gets the value of the 'isExternalConstructor' field.
086   */
087  public java.lang.Boolean getIsExternalConstructor() {
088    return isExternalConstructor;
089  }
090
091  /**
092   * Sets the value of the 'isExternalConstructor' field.
093   * @param value the value to set.
094   */
095  public void setIsExternalConstructor(java.lang.Boolean value) {
096    this.isExternalConstructor = value;
097  }
098
099  /**
100   * Gets the value of the 'isUnit' field.
101   */
102  public java.lang.Boolean getIsUnit() {
103    return isUnit;
104  }
105
106  /**
107   * Sets the value of the 'isUnit' field.
108   * @param value the value to set.
109   */
110  public void setIsUnit(java.lang.Boolean value) {
111    this.isUnit = value;
112  }
113
114  /**
115   * Gets the value of the 'injectableConstructors' field.
116   */
117  public java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef> getInjectableConstructors() {
118    return injectableConstructors;
119  }
120
121  /**
122   * Sets the value of the 'injectableConstructors' field.
123   * @param value the value to set.
124   */
125  public void setInjectableConstructors(java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef> value) {
126    this.injectableConstructors = value;
127  }
128
129  /**
130   * Gets the value of the 'otherConstructors' field.
131   */
132  public java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef> getOtherConstructors() {
133    return otherConstructors;
134  }
135
136  /**
137   * Sets the value of the 'otherConstructors' field.
138   * @param value the value to set.
139   */
140  public void setOtherConstructors(java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef> value) {
141    this.otherConstructors = value;
142  }
143
144  /**
145   * Gets the value of the 'implFullNames' field.
146   */
147  public java.util.List<java.lang.CharSequence> getImplFullNames() {
148    return implFullNames;
149  }
150
151  /**
152   * Sets the value of the 'implFullNames' field.
153   * @param value the value to set.
154   */
155  public void setImplFullNames(java.util.List<java.lang.CharSequence> value) {
156    this.implFullNames = value;
157  }
158
159  /**
160   * Gets the value of the 'defaultImplementation' field.
161   */
162  public java.lang.CharSequence getDefaultImplementation() {
163    return defaultImplementation;
164  }
165
166  /**
167   * Sets the value of the 'defaultImplementation' field.
168   * @param value the value to set.
169   */
170  public void setDefaultImplementation(java.lang.CharSequence value) {
171    this.defaultImplementation = value;
172  }
173
174  /** Creates a new AvroClassNode RecordBuilder */
175  public static org.apache.reef.tang.implementation.avro.AvroClassNode.Builder newBuilder() {
176    return new org.apache.reef.tang.implementation.avro.AvroClassNode.Builder();
177  }
178  
179  /** Creates a new AvroClassNode RecordBuilder by copying an existing Builder */
180  public static org.apache.reef.tang.implementation.avro.AvroClassNode.Builder newBuilder(org.apache.reef.tang.implementation.avro.AvroClassNode.Builder other) {
181    return new org.apache.reef.tang.implementation.avro.AvroClassNode.Builder(other);
182  }
183  
184  /** Creates a new AvroClassNode RecordBuilder by copying an existing AvroClassNode instance */
185  public static org.apache.reef.tang.implementation.avro.AvroClassNode.Builder newBuilder(org.apache.reef.tang.implementation.avro.AvroClassNode other) {
186    return new org.apache.reef.tang.implementation.avro.AvroClassNode.Builder(other);
187  }
188  
189  /**
190   * RecordBuilder for AvroClassNode instances.
191   */
192  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroClassNode>
193    implements org.apache.avro.data.RecordBuilder<AvroClassNode> {
194
195    private boolean isInjectionCandidate;
196    private boolean isExternalConstructor;
197    private boolean isUnit;
198    private java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef> injectableConstructors;
199    private java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef> otherConstructors;
200    private java.util.List<java.lang.CharSequence> implFullNames;
201    private java.lang.CharSequence defaultImplementation;
202
203    /** Creates a new Builder */
204    private Builder() {
205      super(org.apache.reef.tang.implementation.avro.AvroClassNode.SCHEMA$);
206    }
207    
208    /** Creates a Builder by copying an existing Builder */
209    private Builder(org.apache.reef.tang.implementation.avro.AvroClassNode.Builder other) {
210      super(other);
211      if (isValidValue(fields()[0], other.isInjectionCandidate)) {
212        this.isInjectionCandidate = data().deepCopy(fields()[0].schema(), other.isInjectionCandidate);
213        fieldSetFlags()[0] = true;
214      }
215      if (isValidValue(fields()[1], other.isExternalConstructor)) {
216        this.isExternalConstructor = data().deepCopy(fields()[1].schema(), other.isExternalConstructor);
217        fieldSetFlags()[1] = true;
218      }
219      if (isValidValue(fields()[2], other.isUnit)) {
220        this.isUnit = data().deepCopy(fields()[2].schema(), other.isUnit);
221        fieldSetFlags()[2] = true;
222      }
223      if (isValidValue(fields()[3], other.injectableConstructors)) {
224        this.injectableConstructors = data().deepCopy(fields()[3].schema(), other.injectableConstructors);
225        fieldSetFlags()[3] = true;
226      }
227      if (isValidValue(fields()[4], other.otherConstructors)) {
228        this.otherConstructors = data().deepCopy(fields()[4].schema(), other.otherConstructors);
229        fieldSetFlags()[4] = true;
230      }
231      if (isValidValue(fields()[5], other.implFullNames)) {
232        this.implFullNames = data().deepCopy(fields()[5].schema(), other.implFullNames);
233        fieldSetFlags()[5] = true;
234      }
235      if (isValidValue(fields()[6], other.defaultImplementation)) {
236        this.defaultImplementation = data().deepCopy(fields()[6].schema(), other.defaultImplementation);
237        fieldSetFlags()[6] = true;
238      }
239    }
240    
241    /** Creates a Builder by copying an existing AvroClassNode instance */
242    private Builder(org.apache.reef.tang.implementation.avro.AvroClassNode other) {
243            super(org.apache.reef.tang.implementation.avro.AvroClassNode.SCHEMA$);
244      if (isValidValue(fields()[0], other.isInjectionCandidate)) {
245        this.isInjectionCandidate = data().deepCopy(fields()[0].schema(), other.isInjectionCandidate);
246        fieldSetFlags()[0] = true;
247      }
248      if (isValidValue(fields()[1], other.isExternalConstructor)) {
249        this.isExternalConstructor = data().deepCopy(fields()[1].schema(), other.isExternalConstructor);
250        fieldSetFlags()[1] = true;
251      }
252      if (isValidValue(fields()[2], other.isUnit)) {
253        this.isUnit = data().deepCopy(fields()[2].schema(), other.isUnit);
254        fieldSetFlags()[2] = true;
255      }
256      if (isValidValue(fields()[3], other.injectableConstructors)) {
257        this.injectableConstructors = data().deepCopy(fields()[3].schema(), other.injectableConstructors);
258        fieldSetFlags()[3] = true;
259      }
260      if (isValidValue(fields()[4], other.otherConstructors)) {
261        this.otherConstructors = data().deepCopy(fields()[4].schema(), other.otherConstructors);
262        fieldSetFlags()[4] = true;
263      }
264      if (isValidValue(fields()[5], other.implFullNames)) {
265        this.implFullNames = data().deepCopy(fields()[5].schema(), other.implFullNames);
266        fieldSetFlags()[5] = true;
267      }
268      if (isValidValue(fields()[6], other.defaultImplementation)) {
269        this.defaultImplementation = data().deepCopy(fields()[6].schema(), other.defaultImplementation);
270        fieldSetFlags()[6] = true;
271      }
272    }
273
274    /** Gets the value of the 'isInjectionCandidate' field */
275    public java.lang.Boolean getIsInjectionCandidate() {
276      return isInjectionCandidate;
277    }
278    
279    /** Sets the value of the 'isInjectionCandidate' field */
280    public org.apache.reef.tang.implementation.avro.AvroClassNode.Builder setIsInjectionCandidate(boolean value) {
281      validate(fields()[0], value);
282      this.isInjectionCandidate = value;
283      fieldSetFlags()[0] = true;
284      return this; 
285    }
286    
287    /** Checks whether the 'isInjectionCandidate' field has been set */
288    public boolean hasIsInjectionCandidate() {
289      return fieldSetFlags()[0];
290    }
291    
292    /** Clears the value of the 'isInjectionCandidate' field */
293    public org.apache.reef.tang.implementation.avro.AvroClassNode.Builder clearIsInjectionCandidate() {
294      fieldSetFlags()[0] = false;
295      return this;
296    }
297
298    /** Gets the value of the 'isExternalConstructor' field */
299    public java.lang.Boolean getIsExternalConstructor() {
300      return isExternalConstructor;
301    }
302    
303    /** Sets the value of the 'isExternalConstructor' field */
304    public org.apache.reef.tang.implementation.avro.AvroClassNode.Builder setIsExternalConstructor(boolean value) {
305      validate(fields()[1], value);
306      this.isExternalConstructor = value;
307      fieldSetFlags()[1] = true;
308      return this; 
309    }
310    
311    /** Checks whether the 'isExternalConstructor' field has been set */
312    public boolean hasIsExternalConstructor() {
313      return fieldSetFlags()[1];
314    }
315    
316    /** Clears the value of the 'isExternalConstructor' field */
317    public org.apache.reef.tang.implementation.avro.AvroClassNode.Builder clearIsExternalConstructor() {
318      fieldSetFlags()[1] = false;
319      return this;
320    }
321
322    /** Gets the value of the 'isUnit' field */
323    public java.lang.Boolean getIsUnit() {
324      return isUnit;
325    }
326    
327    /** Sets the value of the 'isUnit' field */
328    public org.apache.reef.tang.implementation.avro.AvroClassNode.Builder setIsUnit(boolean value) {
329      validate(fields()[2], value);
330      this.isUnit = value;
331      fieldSetFlags()[2] = true;
332      return this; 
333    }
334    
335    /** Checks whether the 'isUnit' field has been set */
336    public boolean hasIsUnit() {
337      return fieldSetFlags()[2];
338    }
339    
340    /** Clears the value of the 'isUnit' field */
341    public org.apache.reef.tang.implementation.avro.AvroClassNode.Builder clearIsUnit() {
342      fieldSetFlags()[2] = false;
343      return this;
344    }
345
346    /** Gets the value of the 'injectableConstructors' field */
347    public java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef> getInjectableConstructors() {
348      return injectableConstructors;
349    }
350    
351    /** Sets the value of the 'injectableConstructors' field */
352    public org.apache.reef.tang.implementation.avro.AvroClassNode.Builder setInjectableConstructors(java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef> value) {
353      validate(fields()[3], value);
354      this.injectableConstructors = value;
355      fieldSetFlags()[3] = true;
356      return this; 
357    }
358    
359    /** Checks whether the 'injectableConstructors' field has been set */
360    public boolean hasInjectableConstructors() {
361      return fieldSetFlags()[3];
362    }
363    
364    /** Clears the value of the 'injectableConstructors' field */
365    public org.apache.reef.tang.implementation.avro.AvroClassNode.Builder clearInjectableConstructors() {
366      injectableConstructors = null;
367      fieldSetFlags()[3] = false;
368      return this;
369    }
370
371    /** Gets the value of the 'otherConstructors' field */
372    public java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef> getOtherConstructors() {
373      return otherConstructors;
374    }
375    
376    /** Sets the value of the 'otherConstructors' field */
377    public org.apache.reef.tang.implementation.avro.AvroClassNode.Builder setOtherConstructors(java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef> value) {
378      validate(fields()[4], value);
379      this.otherConstructors = value;
380      fieldSetFlags()[4] = true;
381      return this; 
382    }
383    
384    /** Checks whether the 'otherConstructors' field has been set */
385    public boolean hasOtherConstructors() {
386      return fieldSetFlags()[4];
387    }
388    
389    /** Clears the value of the 'otherConstructors' field */
390    public org.apache.reef.tang.implementation.avro.AvroClassNode.Builder clearOtherConstructors() {
391      otherConstructors = null;
392      fieldSetFlags()[4] = false;
393      return this;
394    }
395
396    /** Gets the value of the 'implFullNames' field */
397    public java.util.List<java.lang.CharSequence> getImplFullNames() {
398      return implFullNames;
399    }
400    
401    /** Sets the value of the 'implFullNames' field */
402    public org.apache.reef.tang.implementation.avro.AvroClassNode.Builder setImplFullNames(java.util.List<java.lang.CharSequence> value) {
403      validate(fields()[5], value);
404      this.implFullNames = value;
405      fieldSetFlags()[5] = true;
406      return this; 
407    }
408    
409    /** Checks whether the 'implFullNames' field has been set */
410    public boolean hasImplFullNames() {
411      return fieldSetFlags()[5];
412    }
413    
414    /** Clears the value of the 'implFullNames' field */
415    public org.apache.reef.tang.implementation.avro.AvroClassNode.Builder clearImplFullNames() {
416      implFullNames = null;
417      fieldSetFlags()[5] = false;
418      return this;
419    }
420
421    /** Gets the value of the 'defaultImplementation' field */
422    public java.lang.CharSequence getDefaultImplementation() {
423      return defaultImplementation;
424    }
425    
426    /** Sets the value of the 'defaultImplementation' field */
427    public org.apache.reef.tang.implementation.avro.AvroClassNode.Builder setDefaultImplementation(java.lang.CharSequence value) {
428      validate(fields()[6], value);
429      this.defaultImplementation = value;
430      fieldSetFlags()[6] = true;
431      return this; 
432    }
433    
434    /** Checks whether the 'defaultImplementation' field has been set */
435    public boolean hasDefaultImplementation() {
436      return fieldSetFlags()[6];
437    }
438    
439    /** Clears the value of the 'defaultImplementation' field */
440    public org.apache.reef.tang.implementation.avro.AvroClassNode.Builder clearDefaultImplementation() {
441      defaultImplementation = null;
442      fieldSetFlags()[6] = false;
443      return this;
444    }
445
446    @Override
447    public AvroClassNode build() {
448      try {
449        AvroClassNode record = new AvroClassNode();
450        record.isInjectionCandidate = fieldSetFlags()[0] ? this.isInjectionCandidate : (java.lang.Boolean) defaultValue(fields()[0]);
451        record.isExternalConstructor = fieldSetFlags()[1] ? this.isExternalConstructor : (java.lang.Boolean) defaultValue(fields()[1]);
452        record.isUnit = fieldSetFlags()[2] ? this.isUnit : (java.lang.Boolean) defaultValue(fields()[2]);
453        record.injectableConstructors = fieldSetFlags()[3] ? this.injectableConstructors : (java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef>) defaultValue(fields()[3]);
454        record.otherConstructors = fieldSetFlags()[4] ? this.otherConstructors : (java.util.List<org.apache.reef.tang.implementation.avro.AvroConstructorDef>) defaultValue(fields()[4]);
455        record.implFullNames = fieldSetFlags()[5] ? this.implFullNames : (java.util.List<java.lang.CharSequence>) defaultValue(fields()[5]);
456        record.defaultImplementation = fieldSetFlags()[6] ? this.defaultImplementation : (java.lang.CharSequence) defaultValue(fields()[6]);
457        return record;
458      } catch (Exception e) {
459        throw new org.apache.avro.AvroRuntimeException(e);
460      }
461    }
462  }
463}