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.vortex.common.avro;  
007@SuppressWarnings("all")
008@org.apache.avro.specific.AvroGenerated
009public class AvroTaskletResultReport 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\":\"AvroTaskletResultReport\",\"namespace\":\"org.apache.reef.vortex.common.avro\",\"fields\":[{\"name\":\"taskletId\",\"type\":\"int\"},{\"name\":\"serializedOutput\",\"type\":\"bytes\"}]}");
011  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
012  @Deprecated public int taskletId;
013  @Deprecated public java.nio.ByteBuffer serializedOutput;
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 AvroTaskletResultReport() {}
021
022  /**
023   * All-args constructor.
024   */
025  public AvroTaskletResultReport(java.lang.Integer taskletId, java.nio.ByteBuffer serializedOutput) {
026    this.taskletId = taskletId;
027    this.serializedOutput = serializedOutput;
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 taskletId;
035    case 1: return serializedOutput;
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: taskletId = (java.lang.Integer)value$; break;
044    case 1: serializedOutput = (java.nio.ByteBuffer)value$; break;
045    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
046    }
047  }
048
049  /**
050   * Gets the value of the 'taskletId' field.
051   */
052  public java.lang.Integer getTaskletId() {
053    return taskletId;
054  }
055
056  /**
057   * Sets the value of the 'taskletId' field.
058   * @param value the value to set.
059   */
060  public void setTaskletId(java.lang.Integer value) {
061    this.taskletId = value;
062  }
063
064  /**
065   * Gets the value of the 'serializedOutput' field.
066   */
067  public java.nio.ByteBuffer getSerializedOutput() {
068    return serializedOutput;
069  }
070
071  /**
072   * Sets the value of the 'serializedOutput' field.
073   * @param value the value to set.
074   */
075  public void setSerializedOutput(java.nio.ByteBuffer value) {
076    this.serializedOutput = value;
077  }
078
079  /** Creates a new AvroTaskletResultReport RecordBuilder */
080  public static org.apache.reef.vortex.common.avro.AvroTaskletResultReport.Builder newBuilder() {
081    return new org.apache.reef.vortex.common.avro.AvroTaskletResultReport.Builder();
082  }
083  
084  /** Creates a new AvroTaskletResultReport RecordBuilder by copying an existing Builder */
085  public static org.apache.reef.vortex.common.avro.AvroTaskletResultReport.Builder newBuilder(org.apache.reef.vortex.common.avro.AvroTaskletResultReport.Builder other) {
086    return new org.apache.reef.vortex.common.avro.AvroTaskletResultReport.Builder(other);
087  }
088  
089  /** Creates a new AvroTaskletResultReport RecordBuilder by copying an existing AvroTaskletResultReport instance */
090  public static org.apache.reef.vortex.common.avro.AvroTaskletResultReport.Builder newBuilder(org.apache.reef.vortex.common.avro.AvroTaskletResultReport other) {
091    return new org.apache.reef.vortex.common.avro.AvroTaskletResultReport.Builder(other);
092  }
093  
094  /**
095   * RecordBuilder for AvroTaskletResultReport instances.
096   */
097  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroTaskletResultReport>
098    implements org.apache.avro.data.RecordBuilder<AvroTaskletResultReport> {
099
100    private int taskletId;
101    private java.nio.ByteBuffer serializedOutput;
102
103    /** Creates a new Builder */
104    private Builder() {
105      super(org.apache.reef.vortex.common.avro.AvroTaskletResultReport.SCHEMA$);
106    }
107    
108    /** Creates a Builder by copying an existing Builder */
109    private Builder(org.apache.reef.vortex.common.avro.AvroTaskletResultReport.Builder other) {
110      super(other);
111      if (isValidValue(fields()[0], other.taskletId)) {
112        this.taskletId = data().deepCopy(fields()[0].schema(), other.taskletId);
113        fieldSetFlags()[0] = true;
114      }
115      if (isValidValue(fields()[1], other.serializedOutput)) {
116        this.serializedOutput = data().deepCopy(fields()[1].schema(), other.serializedOutput);
117        fieldSetFlags()[1] = true;
118      }
119    }
120    
121    /** Creates a Builder by copying an existing AvroTaskletResultReport instance */
122    private Builder(org.apache.reef.vortex.common.avro.AvroTaskletResultReport other) {
123            super(org.apache.reef.vortex.common.avro.AvroTaskletResultReport.SCHEMA$);
124      if (isValidValue(fields()[0], other.taskletId)) {
125        this.taskletId = data().deepCopy(fields()[0].schema(), other.taskletId);
126        fieldSetFlags()[0] = true;
127      }
128      if (isValidValue(fields()[1], other.serializedOutput)) {
129        this.serializedOutput = data().deepCopy(fields()[1].schema(), other.serializedOutput);
130        fieldSetFlags()[1] = true;
131      }
132    }
133
134    /** Gets the value of the 'taskletId' field */
135    public java.lang.Integer getTaskletId() {
136      return taskletId;
137    }
138    
139    /** Sets the value of the 'taskletId' field */
140    public org.apache.reef.vortex.common.avro.AvroTaskletResultReport.Builder setTaskletId(int value) {
141      validate(fields()[0], value);
142      this.taskletId = value;
143      fieldSetFlags()[0] = true;
144      return this; 
145    }
146    
147    /** Checks whether the 'taskletId' field has been set */
148    public boolean hasTaskletId() {
149      return fieldSetFlags()[0];
150    }
151    
152    /** Clears the value of the 'taskletId' field */
153    public org.apache.reef.vortex.common.avro.AvroTaskletResultReport.Builder clearTaskletId() {
154      fieldSetFlags()[0] = false;
155      return this;
156    }
157
158    /** Gets the value of the 'serializedOutput' field */
159    public java.nio.ByteBuffer getSerializedOutput() {
160      return serializedOutput;
161    }
162    
163    /** Sets the value of the 'serializedOutput' field */
164    public org.apache.reef.vortex.common.avro.AvroTaskletResultReport.Builder setSerializedOutput(java.nio.ByteBuffer value) {
165      validate(fields()[1], value);
166      this.serializedOutput = value;
167      fieldSetFlags()[1] = true;
168      return this; 
169    }
170    
171    /** Checks whether the 'serializedOutput' field has been set */
172    public boolean hasSerializedOutput() {
173      return fieldSetFlags()[1];
174    }
175    
176    /** Clears the value of the 'serializedOutput' field */
177    public org.apache.reef.vortex.common.avro.AvroTaskletResultReport.Builder clearSerializedOutput() {
178      serializedOutput = null;
179      fieldSetFlags()[1] = false;
180      return this;
181    }
182
183    @Override
184    public AvroTaskletResultReport build() {
185      try {
186        AvroTaskletResultReport record = new AvroTaskletResultReport();
187        record.taskletId = fieldSetFlags()[0] ? this.taskletId : (java.lang.Integer) defaultValue(fields()[0]);
188        record.serializedOutput = fieldSetFlags()[1] ? this.serializedOutput : (java.nio.ByteBuffer) defaultValue(fields()[1]);
189        return record;
190      } catch (Exception e) {
191        throw new org.apache.avro.AvroRuntimeException(e);
192      }
193    }
194  }
195}