001/**
002 * Autogenerated by Avro
003 *
004 * DO NOT EDIT DIRECTLY
005 */
006package org.apache.reef.javabridge.avro;
007
008import org.apache.avro.specific.SpecificData;
009
010@SuppressWarnings("all")
011/** Defines the schema for the defined runtime names. This avro object is used to pass runtime names to the c# */
012@org.apache.avro.specific.AvroGenerated
013public class DefinedRuntimes extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
014  private static final long serialVersionUID = 4523051084874695836L;
015  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"DefinedRuntimes\",\"namespace\":\"org.apache.reef.javabridge.avro\",\"doc\":\"Defines the schema for the defined runtime names. This avro object is used to pass runtime names to the c#\",\"fields\":[{\"name\":\"runtimeNames\",\"type\":{\"type\":\"array\",\"items\":\"string\"},\"doc\":\"defined runtime names\"}]}");
016  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
017  /** defined runtime names */
018  @Deprecated public java.util.List<java.lang.CharSequence> runtimeNames;
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 DefinedRuntimes() {}
026
027  /**
028   * All-args constructor.
029   * @param runtimeNames defined runtime names
030   */
031  public DefinedRuntimes(java.util.List<java.lang.CharSequence> runtimeNames) {
032    this.runtimeNames = runtimeNames;
033  }
034
035  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
036  // Used by DatumWriter.  Applications should not call.
037  public java.lang.Object get(int field$) {
038    switch (field$) {
039    case 0: return runtimeNames;
040    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
041    }
042  }
043
044  // Used by DatumReader.  Applications should not call.
045  @SuppressWarnings(value="unchecked")
046  public void put(int field$, java.lang.Object value$) {
047    switch (field$) {
048    case 0: runtimeNames = (java.util.List<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 'runtimeNames' field.
055   * @return defined runtime names
056   */
057  public java.util.List<java.lang.CharSequence> getRuntimeNames() {
058    return runtimeNames;
059  }
060
061  /**
062   * Sets the value of the 'runtimeNames' field.
063   * defined runtime names
064   * @param value the value to set.
065   */
066  public void setRuntimeNames(java.util.List<java.lang.CharSequence> value) {
067    this.runtimeNames = value;
068  }
069
070  /**
071   * Creates a new DefinedRuntimes RecordBuilder.
072   * @return A new DefinedRuntimes RecordBuilder
073   */
074  public static org.apache.reef.javabridge.avro.DefinedRuntimes.Builder newBuilder() {
075    return new org.apache.reef.javabridge.avro.DefinedRuntimes.Builder();
076  }
077
078  /**
079   * Creates a new DefinedRuntimes RecordBuilder by copying an existing Builder.
080   * @param other The existing builder to copy.
081   * @return A new DefinedRuntimes RecordBuilder
082   */
083  public static org.apache.reef.javabridge.avro.DefinedRuntimes.Builder newBuilder(org.apache.reef.javabridge.avro.DefinedRuntimes.Builder other) {
084    return new org.apache.reef.javabridge.avro.DefinedRuntimes.Builder(other);
085  }
086
087  /**
088   * Creates a new DefinedRuntimes RecordBuilder by copying an existing DefinedRuntimes instance.
089   * @param other The existing instance to copy.
090   * @return A new DefinedRuntimes RecordBuilder
091   */
092  public static org.apache.reef.javabridge.avro.DefinedRuntimes.Builder newBuilder(org.apache.reef.javabridge.avro.DefinedRuntimes other) {
093    return new org.apache.reef.javabridge.avro.DefinedRuntimes.Builder(other);
094  }
095
096  /**
097   * RecordBuilder for DefinedRuntimes instances.
098   */
099  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<DefinedRuntimes>
100    implements org.apache.avro.data.RecordBuilder<DefinedRuntimes> {
101
102    /** defined runtime names */
103    private java.util.List<java.lang.CharSequence> runtimeNames;
104
105    /** Creates a new Builder */
106    private Builder() {
107      super(SCHEMA$);
108    }
109
110    /**
111     * Creates a Builder by copying an existing Builder.
112     * @param other The existing Builder to copy.
113     */
114    private Builder(org.apache.reef.javabridge.avro.DefinedRuntimes.Builder other) {
115      super(other);
116      if (isValidValue(fields()[0], other.runtimeNames)) {
117        this.runtimeNames = data().deepCopy(fields()[0].schema(), other.runtimeNames);
118        fieldSetFlags()[0] = true;
119      }
120    }
121
122    /**
123     * Creates a Builder by copying an existing DefinedRuntimes instance
124     * @param other The existing instance to copy.
125     */
126    private Builder(org.apache.reef.javabridge.avro.DefinedRuntimes other) {
127            super(SCHEMA$);
128      if (isValidValue(fields()[0], other.runtimeNames)) {
129        this.runtimeNames = data().deepCopy(fields()[0].schema(), other.runtimeNames);
130        fieldSetFlags()[0] = true;
131      }
132    }
133
134    /**
135      * Gets the value of the 'runtimeNames' field.
136      * defined runtime names
137      * @return The value.
138      */
139    public java.util.List<java.lang.CharSequence> getRuntimeNames() {
140      return runtimeNames;
141    }
142
143    /**
144      * Sets the value of the 'runtimeNames' field.
145      * defined runtime names
146      * @param value The value of 'runtimeNames'.
147      * @return This builder.
148      */
149    public org.apache.reef.javabridge.avro.DefinedRuntimes.Builder setRuntimeNames(java.util.List<java.lang.CharSequence> value) {
150      validate(fields()[0], value);
151      this.runtimeNames = value;
152      fieldSetFlags()[0] = true;
153      return this;
154    }
155
156    /**
157      * Checks whether the 'runtimeNames' field has been set.
158      * defined runtime names
159      * @return True if the 'runtimeNames' field has been set, false otherwise.
160      */
161    public boolean hasRuntimeNames() {
162      return fieldSetFlags()[0];
163    }
164
165
166    /**
167      * Clears the value of the 'runtimeNames' field.
168      * defined runtime names
169      * @return This builder.
170      */
171    public org.apache.reef.javabridge.avro.DefinedRuntimes.Builder clearRuntimeNames() {
172      runtimeNames = null;
173      fieldSetFlags()[0] = false;
174      return this;
175    }
176
177    @Override
178    public DefinedRuntimes build() {
179      try {
180        DefinedRuntimes record = new DefinedRuntimes();
181        record.runtimeNames = fieldSetFlags()[0] ? this.runtimeNames : (java.util.List<java.lang.CharSequence>) defaultValue(fields()[0]);
182        return record;
183      } catch (Exception e) {
184        throw new org.apache.avro.AvroRuntimeException(e);
185      }
186    }
187  }
188
189  private static final org.apache.avro.io.DatumWriter
190    WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);
191
192  @Override public void writeExternal(java.io.ObjectOutput out)
193    throws java.io.IOException {
194    WRITER$.write(this, SpecificData.getEncoder(out));
195  }
196
197  private static final org.apache.avro.io.DatumReader
198    READER$ = new org.apache.avro.specific.SpecificDatumReader(SCHEMA$);
199
200  @Override public void readExternal(java.io.ObjectInput in)
201    throws java.io.IOException {
202    READER$.read(this, SpecificData.getDecoder(in));
203  }
204
205}