001/**
002 * Autogenerated by Avro
003 *
004 * DO NOT EDIT DIRECTLY
005 */
006package org.apache.reef.runtime.mesos.util;
007
008import org.apache.avro.specific.SpecificData;
009
010@SuppressWarnings("all")
011@org.apache.avro.specific.AvroGenerated
012public class EvaluatorLaunch extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
013  private static final long serialVersionUID = 2088852905424543468L;
014  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"EvaluatorLaunch\",\"namespace\":\"org.apache.reef.runtime.mesos.util\",\"fields\":[{\"name\":\"identifier\",\"type\":\"string\"},{\"name\":\"command\",\"type\":\"string\"}]}");
015  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
016  @Deprecated public java.lang.CharSequence identifier;
017  @Deprecated public java.lang.CharSequence command;
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 EvaluatorLaunch() {}
025
026  /**
027   * All-args constructor.
028   * @param identifier The new value for identifier
029   * @param command The new value for command
030   */
031  public EvaluatorLaunch(java.lang.CharSequence identifier, java.lang.CharSequence command) {
032    this.identifier = identifier;
033    this.command = command;
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 identifier;
041    case 1: return command;
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: identifier = (java.lang.CharSequence)value$; break;
051    case 1: command = (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 'identifier' field.
058   * @return The value of the 'identifier' field.
059   */
060  public java.lang.CharSequence getIdentifier() {
061    return identifier;
062  }
063
064  /**
065   * Sets the value of the 'identifier' field.
066   * @param value the value to set.
067   */
068  public void setIdentifier(java.lang.CharSequence value) {
069    this.identifier = value;
070  }
071
072  /**
073   * Gets the value of the 'command' field.
074   * @return The value of the 'command' field.
075   */
076  public java.lang.CharSequence getCommand() {
077    return command;
078  }
079
080  /**
081   * Sets the value of the 'command' field.
082   * @param value the value to set.
083   */
084  public void setCommand(java.lang.CharSequence value) {
085    this.command = value;
086  }
087
088  /**
089   * Creates a new EvaluatorLaunch RecordBuilder.
090   * @return A new EvaluatorLaunch RecordBuilder
091   */
092  public static org.apache.reef.runtime.mesos.util.EvaluatorLaunch.Builder newBuilder() {
093    return new org.apache.reef.runtime.mesos.util.EvaluatorLaunch.Builder();
094  }
095
096  /**
097   * Creates a new EvaluatorLaunch RecordBuilder by copying an existing Builder.
098   * @param other The existing builder to copy.
099   * @return A new EvaluatorLaunch RecordBuilder
100   */
101  public static org.apache.reef.runtime.mesos.util.EvaluatorLaunch.Builder newBuilder(org.apache.reef.runtime.mesos.util.EvaluatorLaunch.Builder other) {
102    return new org.apache.reef.runtime.mesos.util.EvaluatorLaunch.Builder(other);
103  }
104
105  /**
106   * Creates a new EvaluatorLaunch RecordBuilder by copying an existing EvaluatorLaunch instance.
107   * @param other The existing instance to copy.
108   * @return A new EvaluatorLaunch RecordBuilder
109   */
110  public static org.apache.reef.runtime.mesos.util.EvaluatorLaunch.Builder newBuilder(org.apache.reef.runtime.mesos.util.EvaluatorLaunch other) {
111    return new org.apache.reef.runtime.mesos.util.EvaluatorLaunch.Builder(other);
112  }
113
114  /**
115   * RecordBuilder for EvaluatorLaunch instances.
116   */
117  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<EvaluatorLaunch>
118    implements org.apache.avro.data.RecordBuilder<EvaluatorLaunch> {
119
120    private java.lang.CharSequence identifier;
121    private java.lang.CharSequence command;
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.runtime.mesos.util.EvaluatorLaunch.Builder other) {
133      super(other);
134      if (isValidValue(fields()[0], other.identifier)) {
135        this.identifier = data().deepCopy(fields()[0].schema(), other.identifier);
136        fieldSetFlags()[0] = true;
137      }
138      if (isValidValue(fields()[1], other.command)) {
139        this.command = data().deepCopy(fields()[1].schema(), other.command);
140        fieldSetFlags()[1] = true;
141      }
142    }
143
144    /**
145     * Creates a Builder by copying an existing EvaluatorLaunch instance
146     * @param other The existing instance to copy.
147     */
148    private Builder(org.apache.reef.runtime.mesos.util.EvaluatorLaunch other) {
149            super(SCHEMA$);
150      if (isValidValue(fields()[0], other.identifier)) {
151        this.identifier = data().deepCopy(fields()[0].schema(), other.identifier);
152        fieldSetFlags()[0] = true;
153      }
154      if (isValidValue(fields()[1], other.command)) {
155        this.command = data().deepCopy(fields()[1].schema(), other.command);
156        fieldSetFlags()[1] = true;
157      }
158    }
159
160    /**
161      * Gets the value of the 'identifier' field.
162      * @return The value.
163      */
164    public java.lang.CharSequence getIdentifier() {
165      return identifier;
166    }
167
168    /**
169      * Sets the value of the 'identifier' field.
170      * @param value The value of 'identifier'.
171      * @return This builder.
172      */
173    public org.apache.reef.runtime.mesos.util.EvaluatorLaunch.Builder setIdentifier(java.lang.CharSequence value) {
174      validate(fields()[0], value);
175      this.identifier = value;
176      fieldSetFlags()[0] = true;
177      return this;
178    }
179
180    /**
181      * Checks whether the 'identifier' field has been set.
182      * @return True if the 'identifier' field has been set, false otherwise.
183      */
184    public boolean hasIdentifier() {
185      return fieldSetFlags()[0];
186    }
187
188
189    /**
190      * Clears the value of the 'identifier' field.
191      * @return This builder.
192      */
193    public org.apache.reef.runtime.mesos.util.EvaluatorLaunch.Builder clearIdentifier() {
194      identifier = null;
195      fieldSetFlags()[0] = false;
196      return this;
197    }
198
199    /**
200      * Gets the value of the 'command' field.
201      * @return The value.
202      */
203    public java.lang.CharSequence getCommand() {
204      return command;
205    }
206
207    /**
208      * Sets the value of the 'command' field.
209      * @param value The value of 'command'.
210      * @return This builder.
211      */
212    public org.apache.reef.runtime.mesos.util.EvaluatorLaunch.Builder setCommand(java.lang.CharSequence value) {
213      validate(fields()[1], value);
214      this.command = value;
215      fieldSetFlags()[1] = true;
216      return this;
217    }
218
219    /**
220      * Checks whether the 'command' field has been set.
221      * @return True if the 'command' field has been set, false otherwise.
222      */
223    public boolean hasCommand() {
224      return fieldSetFlags()[1];
225    }
226
227
228    /**
229      * Clears the value of the 'command' field.
230      * @return This builder.
231      */
232    public org.apache.reef.runtime.mesos.util.EvaluatorLaunch.Builder clearCommand() {
233      command = null;
234      fieldSetFlags()[1] = false;
235      return this;
236    }
237
238    @Override
239    public EvaluatorLaunch build() {
240      try {
241        EvaluatorLaunch record = new EvaluatorLaunch();
242        record.identifier = fieldSetFlags()[0] ? this.identifier : (java.lang.CharSequence) defaultValue(fields()[0]);
243        record.command = fieldSetFlags()[1] ? this.command : (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}