This project has retired. For details please refer to its Attic page.
Source code
001/**
002 * Autogenerated by Avro
003 * 
004 * DO NOT EDIT DIRECTLY
005 */
006package org.apache.reef.runtime.mesos.util;  
007@SuppressWarnings("all")
008@org.apache.avro.specific.AvroGenerated
009public class EvaluatorControl 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\":\"EvaluatorControl\",\"namespace\":\"org.apache.reef.runtime.mesos.util\",\"fields\":[{\"name\":\"evaluator_launch\",\"type\":[{\"type\":\"record\",\"name\":\"EvaluatorLaunch\",\"fields\":[{\"name\":\"identifier\",\"type\":\"string\"},{\"name\":\"command\",\"type\":\"string\"}]},\"null\"]},{\"name\":\"evaluator_release\",\"type\":[{\"type\":\"record\",\"name\":\"EvaluatorRelease\",\"fields\":[{\"name\":\"identifier\",\"type\":\"string\"}]},\"null\"]}]}");
011  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
012  @Deprecated public org.apache.reef.runtime.mesos.util.EvaluatorLaunch evaluator_launch;
013  @Deprecated public org.apache.reef.runtime.mesos.util.EvaluatorRelease evaluator_release;
014
015  /**
016   * Default constructor.  Note that this does not initialize fields
017   * to their default values from the schema.  If that is desired then
018   * one should use <code>newBuilder()</code>. 
019   */
020  public EvaluatorControl() {}
021
022  /**
023   * All-args constructor.
024   */
025  public EvaluatorControl(org.apache.reef.runtime.mesos.util.EvaluatorLaunch evaluator_launch, org.apache.reef.runtime.mesos.util.EvaluatorRelease evaluator_release) {
026    this.evaluator_launch = evaluator_launch;
027    this.evaluator_release = evaluator_release;
028  }
029
030  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
031  // Used by DatumWriter.  Applications should not call. 
032  public java.lang.Object get(int field$) {
033    switch (field$) {
034    case 0: return evaluator_launch;
035    case 1: return evaluator_release;
036    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
037    }
038  }
039  // Used by DatumReader.  Applications should not call. 
040  @SuppressWarnings(value="unchecked")
041  public void put(int field$, java.lang.Object value$) {
042    switch (field$) {
043    case 0: evaluator_launch = (org.apache.reef.runtime.mesos.util.EvaluatorLaunch)value$; break;
044    case 1: evaluator_release = (org.apache.reef.runtime.mesos.util.EvaluatorRelease)value$; break;
045    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
046    }
047  }
048
049  /**
050   * Gets the value of the 'evaluator_launch' field.
051   */
052  public org.apache.reef.runtime.mesos.util.EvaluatorLaunch getEvaluatorLaunch() {
053    return evaluator_launch;
054  }
055
056  /**
057   * Sets the value of the 'evaluator_launch' field.
058   * @param value the value to set.
059   */
060  public void setEvaluatorLaunch(org.apache.reef.runtime.mesos.util.EvaluatorLaunch value) {
061    this.evaluator_launch = value;
062  }
063
064  /**
065   * Gets the value of the 'evaluator_release' field.
066   */
067  public org.apache.reef.runtime.mesos.util.EvaluatorRelease getEvaluatorRelease() {
068    return evaluator_release;
069  }
070
071  /**
072   * Sets the value of the 'evaluator_release' field.
073   * @param value the value to set.
074   */
075  public void setEvaluatorRelease(org.apache.reef.runtime.mesos.util.EvaluatorRelease value) {
076    this.evaluator_release = value;
077  }
078
079  /** Creates a new EvaluatorControl RecordBuilder */
080  public static org.apache.reef.runtime.mesos.util.EvaluatorControl.Builder newBuilder() {
081    return new org.apache.reef.runtime.mesos.util.EvaluatorControl.Builder();
082  }
083  
084  /** Creates a new EvaluatorControl RecordBuilder by copying an existing Builder */
085  public static org.apache.reef.runtime.mesos.util.EvaluatorControl.Builder newBuilder(org.apache.reef.runtime.mesos.util.EvaluatorControl.Builder other) {
086    return new org.apache.reef.runtime.mesos.util.EvaluatorControl.Builder(other);
087  }
088  
089  /** Creates a new EvaluatorControl RecordBuilder by copying an existing EvaluatorControl instance */
090  public static org.apache.reef.runtime.mesos.util.EvaluatorControl.Builder newBuilder(org.apache.reef.runtime.mesos.util.EvaluatorControl other) {
091    return new org.apache.reef.runtime.mesos.util.EvaluatorControl.Builder(other);
092  }
093  
094  /**
095   * RecordBuilder for EvaluatorControl instances.
096   */
097  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<EvaluatorControl>
098    implements org.apache.avro.data.RecordBuilder<EvaluatorControl> {
099
100    private org.apache.reef.runtime.mesos.util.EvaluatorLaunch evaluator_launch;
101    private org.apache.reef.runtime.mesos.util.EvaluatorRelease evaluator_release;
102
103    /** Creates a new Builder */
104    private Builder() {
105      super(org.apache.reef.runtime.mesos.util.EvaluatorControl.SCHEMA$);
106    }
107    
108    /** Creates a Builder by copying an existing Builder */
109    private Builder(org.apache.reef.runtime.mesos.util.EvaluatorControl.Builder other) {
110      super(other);
111      if (isValidValue(fields()[0], other.evaluator_launch)) {
112        this.evaluator_launch = data().deepCopy(fields()[0].schema(), other.evaluator_launch);
113        fieldSetFlags()[0] = true;
114      }
115      if (isValidValue(fields()[1], other.evaluator_release)) {
116        this.evaluator_release = data().deepCopy(fields()[1].schema(), other.evaluator_release);
117        fieldSetFlags()[1] = true;
118      }
119    }
120    
121    /** Creates a Builder by copying an existing EvaluatorControl instance */
122    private Builder(org.apache.reef.runtime.mesos.util.EvaluatorControl other) {
123            super(org.apache.reef.runtime.mesos.util.EvaluatorControl.SCHEMA$);
124      if (isValidValue(fields()[0], other.evaluator_launch)) {
125        this.evaluator_launch = data().deepCopy(fields()[0].schema(), other.evaluator_launch);
126        fieldSetFlags()[0] = true;
127      }
128      if (isValidValue(fields()[1], other.evaluator_release)) {
129        this.evaluator_release = data().deepCopy(fields()[1].schema(), other.evaluator_release);
130        fieldSetFlags()[1] = true;
131      }
132    }
133
134    /** Gets the value of the 'evaluator_launch' field */
135    public org.apache.reef.runtime.mesos.util.EvaluatorLaunch getEvaluatorLaunch() {
136      return evaluator_launch;
137    }
138    
139    /** Sets the value of the 'evaluator_launch' field */
140    public org.apache.reef.runtime.mesos.util.EvaluatorControl.Builder setEvaluatorLaunch(org.apache.reef.runtime.mesos.util.EvaluatorLaunch value) {
141      validate(fields()[0], value);
142      this.evaluator_launch = value;
143      fieldSetFlags()[0] = true;
144      return this; 
145    }
146    
147    /** Checks whether the 'evaluator_launch' field has been set */
148    public boolean hasEvaluatorLaunch() {
149      return fieldSetFlags()[0];
150    }
151    
152    /** Clears the value of the 'evaluator_launch' field */
153    public org.apache.reef.runtime.mesos.util.EvaluatorControl.Builder clearEvaluatorLaunch() {
154      evaluator_launch = null;
155      fieldSetFlags()[0] = false;
156      return this;
157    }
158
159    /** Gets the value of the 'evaluator_release' field */
160    public org.apache.reef.runtime.mesos.util.EvaluatorRelease getEvaluatorRelease() {
161      return evaluator_release;
162    }
163    
164    /** Sets the value of the 'evaluator_release' field */
165    public org.apache.reef.runtime.mesos.util.EvaluatorControl.Builder setEvaluatorRelease(org.apache.reef.runtime.mesos.util.EvaluatorRelease value) {
166      validate(fields()[1], value);
167      this.evaluator_release = value;
168      fieldSetFlags()[1] = true;
169      return this; 
170    }
171    
172    /** Checks whether the 'evaluator_release' field has been set */
173    public boolean hasEvaluatorRelease() {
174      return fieldSetFlags()[1];
175    }
176    
177    /** Clears the value of the 'evaluator_release' field */
178    public org.apache.reef.runtime.mesos.util.EvaluatorControl.Builder clearEvaluatorRelease() {
179      evaluator_release = null;
180      fieldSetFlags()[1] = false;
181      return this;
182    }
183
184    @Override
185    public EvaluatorControl build() {
186      try {
187        EvaluatorControl record = new EvaluatorControl();
188        record.evaluator_launch = fieldSetFlags()[0] ? this.evaluator_launch : (org.apache.reef.runtime.mesos.util.EvaluatorLaunch) defaultValue(fields()[0]);
189        record.evaluator_release = fieldSetFlags()[1] ? this.evaluator_release : (org.apache.reef.runtime.mesos.util.EvaluatorRelease) defaultValue(fields()[1]);
190        return record;
191      } catch (Exception e) {
192        throw new org.apache.avro.AvroRuntimeException(e);
193      }
194    }
195  }
196}