All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.reef.javabridge.avro.DefinedRuntimes Maven / Gradle / Ivy

There is a newer version: 0.16.0
Show newest version
/**
 * Autogenerated by Avro
 * 
 * DO NOT EDIT DIRECTLY
 */
package org.apache.reef.javabridge.avro;  
@SuppressWarnings("all")
/** Defines the schema for the defined runtime names. This avro object is used to pass runtime names to the c# */
@org.apache.avro.specific.AvroGenerated
public class DefinedRuntimes extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  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\"}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  /** defined runtime names */
  @Deprecated public java.util.List runtimeNames;

  /**
   * Default constructor.  Note that this does not initialize fields
   * to their default values from the schema.  If that is desired then
   * one should use newBuilder(). 
   */
  public DefinedRuntimes() {}

  /**
   * All-args constructor.
   */
  public DefinedRuntimes(java.util.List runtimeNames) {
    this.runtimeNames = runtimeNames;
  }

  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
  // Used by DatumWriter.  Applications should not call. 
  public java.lang.Object get(int field$) {
    switch (field$) {
    case 0: return runtimeNames;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }
  // Used by DatumReader.  Applications should not call. 
  @SuppressWarnings(value="unchecked")
  public void put(int field$, java.lang.Object value$) {
    switch (field$) {
    case 0: runtimeNames = (java.util.List)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'runtimeNames' field.
   * defined runtime names   */
  public java.util.List getRuntimeNames() {
    return runtimeNames;
  }

  /**
   * Sets the value of the 'runtimeNames' field.
   * defined runtime names   * @param value the value to set.
   */
  public void setRuntimeNames(java.util.List value) {
    this.runtimeNames = value;
  }

  /** Creates a new DefinedRuntimes RecordBuilder */
  public static org.apache.reef.javabridge.avro.DefinedRuntimes.Builder newBuilder() {
    return new org.apache.reef.javabridge.avro.DefinedRuntimes.Builder();
  }
  
  /** Creates a new DefinedRuntimes RecordBuilder by copying an existing Builder */
  public static org.apache.reef.javabridge.avro.DefinedRuntimes.Builder newBuilder(org.apache.reef.javabridge.avro.DefinedRuntimes.Builder other) {
    return new org.apache.reef.javabridge.avro.DefinedRuntimes.Builder(other);
  }
  
  /** Creates a new DefinedRuntimes RecordBuilder by copying an existing DefinedRuntimes instance */
  public static org.apache.reef.javabridge.avro.DefinedRuntimes.Builder newBuilder(org.apache.reef.javabridge.avro.DefinedRuntimes other) {
    return new org.apache.reef.javabridge.avro.DefinedRuntimes.Builder(other);
  }
  
  /**
   * RecordBuilder for DefinedRuntimes instances.
   */
  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
    implements org.apache.avro.data.RecordBuilder {

    private java.util.List runtimeNames;

    /** Creates a new Builder */
    private Builder() {
      super(org.apache.reef.javabridge.avro.DefinedRuntimes.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(org.apache.reef.javabridge.avro.DefinedRuntimes.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.runtimeNames)) {
        this.runtimeNames = data().deepCopy(fields()[0].schema(), other.runtimeNames);
        fieldSetFlags()[0] = true;
      }
    }
    
    /** Creates a Builder by copying an existing DefinedRuntimes instance */
    private Builder(org.apache.reef.javabridge.avro.DefinedRuntimes other) {
            super(org.apache.reef.javabridge.avro.DefinedRuntimes.SCHEMA$);
      if (isValidValue(fields()[0], other.runtimeNames)) {
        this.runtimeNames = data().deepCopy(fields()[0].schema(), other.runtimeNames);
        fieldSetFlags()[0] = true;
      }
    }

    /** Gets the value of the 'runtimeNames' field */
    public java.util.List getRuntimeNames() {
      return runtimeNames;
    }
    
    /** Sets the value of the 'runtimeNames' field */
    public org.apache.reef.javabridge.avro.DefinedRuntimes.Builder setRuntimeNames(java.util.List value) {
      validate(fields()[0], value);
      this.runtimeNames = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'runtimeNames' field has been set */
    public boolean hasRuntimeNames() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'runtimeNames' field */
    public org.apache.reef.javabridge.avro.DefinedRuntimes.Builder clearRuntimeNames() {
      runtimeNames = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    @Override
    public DefinedRuntimes build() {
      try {
        DefinedRuntimes record = new DefinedRuntimes();
        record.runtimeNames = fieldSetFlags()[0] ? this.runtimeNames : (java.util.List) defaultValue(fields()[0]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy