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.javabridge.avro;  
007@SuppressWarnings("all")
008/** Defines the schema for the defined runtime names. This avro object is used to pass runtime names to the c# */
009@org.apache.avro.specific.AvroGenerated
010public class DefinedRuntimes extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
011  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\"}]}");
012  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
013  /** defined runtime names */
014  @Deprecated public java.util.List<java.lang.CharSequence> runtimeNames;
015
016  /**
017   * Default constructor.  Note that this does not initialize fields
018   * to their default values from the schema.  If that is desired then
019   * one should use <code>newBuilder()</code>. 
020   */
021  public DefinedRuntimes() {}
022
023  /**
024   * All-args constructor.
025   */
026  public DefinedRuntimes(java.util.List<java.lang.CharSequence> runtimeNames) {
027    this.runtimeNames = runtimeNames;
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 runtimeNames;
035    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
036    }
037  }
038  // Used by DatumReader.  Applications should not call. 
039  @SuppressWarnings(value="unchecked")
040  public void put(int field$, java.lang.Object value$) {
041    switch (field$) {
042    case 0: runtimeNames = (java.util.List<java.lang.CharSequence>)value$; break;
043    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
044    }
045  }
046
047  /**
048   * Gets the value of the 'runtimeNames' field.
049   * defined runtime names   */
050  public java.util.List<java.lang.CharSequence> getRuntimeNames() {
051    return runtimeNames;
052  }
053
054  /**
055   * Sets the value of the 'runtimeNames' field.
056   * defined runtime names   * @param value the value to set.
057   */
058  public void setRuntimeNames(java.util.List<java.lang.CharSequence> value) {
059    this.runtimeNames = value;
060  }
061
062  /** Creates a new DefinedRuntimes RecordBuilder */
063  public static org.apache.reef.javabridge.avro.DefinedRuntimes.Builder newBuilder() {
064    return new org.apache.reef.javabridge.avro.DefinedRuntimes.Builder();
065  }
066  
067  /** Creates a new DefinedRuntimes RecordBuilder by copying an existing Builder */
068  public static org.apache.reef.javabridge.avro.DefinedRuntimes.Builder newBuilder(org.apache.reef.javabridge.avro.DefinedRuntimes.Builder other) {
069    return new org.apache.reef.javabridge.avro.DefinedRuntimes.Builder(other);
070  }
071  
072  /** Creates a new DefinedRuntimes RecordBuilder by copying an existing DefinedRuntimes instance */
073  public static org.apache.reef.javabridge.avro.DefinedRuntimes.Builder newBuilder(org.apache.reef.javabridge.avro.DefinedRuntimes other) {
074    return new org.apache.reef.javabridge.avro.DefinedRuntimes.Builder(other);
075  }
076  
077  /**
078   * RecordBuilder for DefinedRuntimes instances.
079   */
080  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<DefinedRuntimes>
081    implements org.apache.avro.data.RecordBuilder<DefinedRuntimes> {
082
083    private java.util.List<java.lang.CharSequence> runtimeNames;
084
085    /** Creates a new Builder */
086    private Builder() {
087      super(org.apache.reef.javabridge.avro.DefinedRuntimes.SCHEMA$);
088    }
089    
090    /** Creates a Builder by copying an existing Builder */
091    private Builder(org.apache.reef.javabridge.avro.DefinedRuntimes.Builder other) {
092      super(other);
093      if (isValidValue(fields()[0], other.runtimeNames)) {
094        this.runtimeNames = data().deepCopy(fields()[0].schema(), other.runtimeNames);
095        fieldSetFlags()[0] = true;
096      }
097    }
098    
099    /** Creates a Builder by copying an existing DefinedRuntimes instance */
100    private Builder(org.apache.reef.javabridge.avro.DefinedRuntimes other) {
101            super(org.apache.reef.javabridge.avro.DefinedRuntimes.SCHEMA$);
102      if (isValidValue(fields()[0], other.runtimeNames)) {
103        this.runtimeNames = data().deepCopy(fields()[0].schema(), other.runtimeNames);
104        fieldSetFlags()[0] = true;
105      }
106    }
107
108    /** Gets the value of the 'runtimeNames' field */
109    public java.util.List<java.lang.CharSequence> getRuntimeNames() {
110      return runtimeNames;
111    }
112    
113    /** Sets the value of the 'runtimeNames' field */
114    public org.apache.reef.javabridge.avro.DefinedRuntimes.Builder setRuntimeNames(java.util.List<java.lang.CharSequence> value) {
115      validate(fields()[0], value);
116      this.runtimeNames = value;
117      fieldSetFlags()[0] = true;
118      return this; 
119    }
120    
121    /** Checks whether the 'runtimeNames' field has been set */
122    public boolean hasRuntimeNames() {
123      return fieldSetFlags()[0];
124    }
125    
126    /** Clears the value of the 'runtimeNames' field */
127    public org.apache.reef.javabridge.avro.DefinedRuntimes.Builder clearRuntimeNames() {
128      runtimeNames = null;
129      fieldSetFlags()[0] = false;
130      return this;
131    }
132
133    @Override
134    public DefinedRuntimes build() {
135      try {
136        DefinedRuntimes record = new DefinedRuntimes();
137        record.runtimeNames = fieldSetFlags()[0] ? this.runtimeNames : (java.util.List<java.lang.CharSequence>) defaultValue(fields()[0]);
138        return record;
139      } catch (Exception e) {
140        throw new org.apache.avro.AvroRuntimeException(e);
141      }
142    }
143  }
144}