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.webserver;  
007@SuppressWarnings("all")
008@org.apache.avro.specific.AvroGenerated
009public class AvroHttpRequest 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\":\"AvroHttpRequest\",\"namespace\":\"org.apache.reef.webserver\",\"fields\":[{\"name\":\"requestUrl\",\"type\":\"string\"},{\"name\":\"pathInfo\",\"type\":\"string\"},{\"name\":\"queryString\",\"type\":\"string\"},{\"name\":\"httpMethod\",\"type\":\"string\"},{\"name\":\"inputStream\",\"type\":\"bytes\"}]}");
011  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
012  @Deprecated public java.lang.CharSequence requestUrl;
013  @Deprecated public java.lang.CharSequence pathInfo;
014  @Deprecated public java.lang.CharSequence queryString;
015  @Deprecated public java.lang.CharSequence httpMethod;
016  @Deprecated public java.nio.ByteBuffer inputStream;
017
018  /**
019   * Default constructor.  Note that this does not initialize fields
020   * to their default values from the schema.  If that is desired then
021   * one should use <code>newBuilder()</code>. 
022   */
023  public AvroHttpRequest() {}
024
025  /**
026   * All-args constructor.
027   */
028  public AvroHttpRequest(java.lang.CharSequence requestUrl, java.lang.CharSequence pathInfo, java.lang.CharSequence queryString, java.lang.CharSequence httpMethod, java.nio.ByteBuffer inputStream) {
029    this.requestUrl = requestUrl;
030    this.pathInfo = pathInfo;
031    this.queryString = queryString;
032    this.httpMethod = httpMethod;
033    this.inputStream = inputStream;
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 requestUrl;
041    case 1: return pathInfo;
042    case 2: return queryString;
043    case 3: return httpMethod;
044    case 4: return inputStream;
045    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
046    }
047  }
048  // Used by DatumReader.  Applications should not call. 
049  @SuppressWarnings(value="unchecked")
050  public void put(int field$, java.lang.Object value$) {
051    switch (field$) {
052    case 0: requestUrl = (java.lang.CharSequence)value$; break;
053    case 1: pathInfo = (java.lang.CharSequence)value$; break;
054    case 2: queryString = (java.lang.CharSequence)value$; break;
055    case 3: httpMethod = (java.lang.CharSequence)value$; break;
056    case 4: inputStream = (java.nio.ByteBuffer)value$; break;
057    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
058    }
059  }
060
061  /**
062   * Gets the value of the 'requestUrl' field.
063   */
064  public java.lang.CharSequence getRequestUrl() {
065    return requestUrl;
066  }
067
068  /**
069   * Sets the value of the 'requestUrl' field.
070   * @param value the value to set.
071   */
072  public void setRequestUrl(java.lang.CharSequence value) {
073    this.requestUrl = value;
074  }
075
076  /**
077   * Gets the value of the 'pathInfo' field.
078   */
079  public java.lang.CharSequence getPathInfo() {
080    return pathInfo;
081  }
082
083  /**
084   * Sets the value of the 'pathInfo' field.
085   * @param value the value to set.
086   */
087  public void setPathInfo(java.lang.CharSequence value) {
088    this.pathInfo = value;
089  }
090
091  /**
092   * Gets the value of the 'queryString' field.
093   */
094  public java.lang.CharSequence getQueryString() {
095    return queryString;
096  }
097
098  /**
099   * Sets the value of the 'queryString' field.
100   * @param value the value to set.
101   */
102  public void setQueryString(java.lang.CharSequence value) {
103    this.queryString = value;
104  }
105
106  /**
107   * Gets the value of the 'httpMethod' field.
108   */
109  public java.lang.CharSequence getHttpMethod() {
110    return httpMethod;
111  }
112
113  /**
114   * Sets the value of the 'httpMethod' field.
115   * @param value the value to set.
116   */
117  public void setHttpMethod(java.lang.CharSequence value) {
118    this.httpMethod = value;
119  }
120
121  /**
122   * Gets the value of the 'inputStream' field.
123   */
124  public java.nio.ByteBuffer getInputStream() {
125    return inputStream;
126  }
127
128  /**
129   * Sets the value of the 'inputStream' field.
130   * @param value the value to set.
131   */
132  public void setInputStream(java.nio.ByteBuffer value) {
133    this.inputStream = value;
134  }
135
136  /** Creates a new AvroHttpRequest RecordBuilder */
137  public static org.apache.reef.webserver.AvroHttpRequest.Builder newBuilder() {
138    return new org.apache.reef.webserver.AvroHttpRequest.Builder();
139  }
140  
141  /** Creates a new AvroHttpRequest RecordBuilder by copying an existing Builder */
142  public static org.apache.reef.webserver.AvroHttpRequest.Builder newBuilder(org.apache.reef.webserver.AvroHttpRequest.Builder other) {
143    return new org.apache.reef.webserver.AvroHttpRequest.Builder(other);
144  }
145  
146  /** Creates a new AvroHttpRequest RecordBuilder by copying an existing AvroHttpRequest instance */
147  public static org.apache.reef.webserver.AvroHttpRequest.Builder newBuilder(org.apache.reef.webserver.AvroHttpRequest other) {
148    return new org.apache.reef.webserver.AvroHttpRequest.Builder(other);
149  }
150  
151  /**
152   * RecordBuilder for AvroHttpRequest instances.
153   */
154  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroHttpRequest>
155    implements org.apache.avro.data.RecordBuilder<AvroHttpRequest> {
156
157    private java.lang.CharSequence requestUrl;
158    private java.lang.CharSequence pathInfo;
159    private java.lang.CharSequence queryString;
160    private java.lang.CharSequence httpMethod;
161    private java.nio.ByteBuffer inputStream;
162
163    /** Creates a new Builder */
164    private Builder() {
165      super(org.apache.reef.webserver.AvroHttpRequest.SCHEMA$);
166    }
167    
168    /** Creates a Builder by copying an existing Builder */
169    private Builder(org.apache.reef.webserver.AvroHttpRequest.Builder other) {
170      super(other);
171      if (isValidValue(fields()[0], other.requestUrl)) {
172        this.requestUrl = data().deepCopy(fields()[0].schema(), other.requestUrl);
173        fieldSetFlags()[0] = true;
174      }
175      if (isValidValue(fields()[1], other.pathInfo)) {
176        this.pathInfo = data().deepCopy(fields()[1].schema(), other.pathInfo);
177        fieldSetFlags()[1] = true;
178      }
179      if (isValidValue(fields()[2], other.queryString)) {
180        this.queryString = data().deepCopy(fields()[2].schema(), other.queryString);
181        fieldSetFlags()[2] = true;
182      }
183      if (isValidValue(fields()[3], other.httpMethod)) {
184        this.httpMethod = data().deepCopy(fields()[3].schema(), other.httpMethod);
185        fieldSetFlags()[3] = true;
186      }
187      if (isValidValue(fields()[4], other.inputStream)) {
188        this.inputStream = data().deepCopy(fields()[4].schema(), other.inputStream);
189        fieldSetFlags()[4] = true;
190      }
191    }
192    
193    /** Creates a Builder by copying an existing AvroHttpRequest instance */
194    private Builder(org.apache.reef.webserver.AvroHttpRequest other) {
195            super(org.apache.reef.webserver.AvroHttpRequest.SCHEMA$);
196      if (isValidValue(fields()[0], other.requestUrl)) {
197        this.requestUrl = data().deepCopy(fields()[0].schema(), other.requestUrl);
198        fieldSetFlags()[0] = true;
199      }
200      if (isValidValue(fields()[1], other.pathInfo)) {
201        this.pathInfo = data().deepCopy(fields()[1].schema(), other.pathInfo);
202        fieldSetFlags()[1] = true;
203      }
204      if (isValidValue(fields()[2], other.queryString)) {
205        this.queryString = data().deepCopy(fields()[2].schema(), other.queryString);
206        fieldSetFlags()[2] = true;
207      }
208      if (isValidValue(fields()[3], other.httpMethod)) {
209        this.httpMethod = data().deepCopy(fields()[3].schema(), other.httpMethod);
210        fieldSetFlags()[3] = true;
211      }
212      if (isValidValue(fields()[4], other.inputStream)) {
213        this.inputStream = data().deepCopy(fields()[4].schema(), other.inputStream);
214        fieldSetFlags()[4] = true;
215      }
216    }
217
218    /** Gets the value of the 'requestUrl' field */
219    public java.lang.CharSequence getRequestUrl() {
220      return requestUrl;
221    }
222    
223    /** Sets the value of the 'requestUrl' field */
224    public org.apache.reef.webserver.AvroHttpRequest.Builder setRequestUrl(java.lang.CharSequence value) {
225      validate(fields()[0], value);
226      this.requestUrl = value;
227      fieldSetFlags()[0] = true;
228      return this; 
229    }
230    
231    /** Checks whether the 'requestUrl' field has been set */
232    public boolean hasRequestUrl() {
233      return fieldSetFlags()[0];
234    }
235    
236    /** Clears the value of the 'requestUrl' field */
237    public org.apache.reef.webserver.AvroHttpRequest.Builder clearRequestUrl() {
238      requestUrl = null;
239      fieldSetFlags()[0] = false;
240      return this;
241    }
242
243    /** Gets the value of the 'pathInfo' field */
244    public java.lang.CharSequence getPathInfo() {
245      return pathInfo;
246    }
247    
248    /** Sets the value of the 'pathInfo' field */
249    public org.apache.reef.webserver.AvroHttpRequest.Builder setPathInfo(java.lang.CharSequence value) {
250      validate(fields()[1], value);
251      this.pathInfo = value;
252      fieldSetFlags()[1] = true;
253      return this; 
254    }
255    
256    /** Checks whether the 'pathInfo' field has been set */
257    public boolean hasPathInfo() {
258      return fieldSetFlags()[1];
259    }
260    
261    /** Clears the value of the 'pathInfo' field */
262    public org.apache.reef.webserver.AvroHttpRequest.Builder clearPathInfo() {
263      pathInfo = null;
264      fieldSetFlags()[1] = false;
265      return this;
266    }
267
268    /** Gets the value of the 'queryString' field */
269    public java.lang.CharSequence getQueryString() {
270      return queryString;
271    }
272    
273    /** Sets the value of the 'queryString' field */
274    public org.apache.reef.webserver.AvroHttpRequest.Builder setQueryString(java.lang.CharSequence value) {
275      validate(fields()[2], value);
276      this.queryString = value;
277      fieldSetFlags()[2] = true;
278      return this; 
279    }
280    
281    /** Checks whether the 'queryString' field has been set */
282    public boolean hasQueryString() {
283      return fieldSetFlags()[2];
284    }
285    
286    /** Clears the value of the 'queryString' field */
287    public org.apache.reef.webserver.AvroHttpRequest.Builder clearQueryString() {
288      queryString = null;
289      fieldSetFlags()[2] = false;
290      return this;
291    }
292
293    /** Gets the value of the 'httpMethod' field */
294    public java.lang.CharSequence getHttpMethod() {
295      return httpMethod;
296    }
297    
298    /** Sets the value of the 'httpMethod' field */
299    public org.apache.reef.webserver.AvroHttpRequest.Builder setHttpMethod(java.lang.CharSequence value) {
300      validate(fields()[3], value);
301      this.httpMethod = value;
302      fieldSetFlags()[3] = true;
303      return this; 
304    }
305    
306    /** Checks whether the 'httpMethod' field has been set */
307    public boolean hasHttpMethod() {
308      return fieldSetFlags()[3];
309    }
310    
311    /** Clears the value of the 'httpMethod' field */
312    public org.apache.reef.webserver.AvroHttpRequest.Builder clearHttpMethod() {
313      httpMethod = null;
314      fieldSetFlags()[3] = false;
315      return this;
316    }
317
318    /** Gets the value of the 'inputStream' field */
319    public java.nio.ByteBuffer getInputStream() {
320      return inputStream;
321    }
322    
323    /** Sets the value of the 'inputStream' field */
324    public org.apache.reef.webserver.AvroHttpRequest.Builder setInputStream(java.nio.ByteBuffer value) {
325      validate(fields()[4], value);
326      this.inputStream = value;
327      fieldSetFlags()[4] = true;
328      return this; 
329    }
330    
331    /** Checks whether the 'inputStream' field has been set */
332    public boolean hasInputStream() {
333      return fieldSetFlags()[4];
334    }
335    
336    /** Clears the value of the 'inputStream' field */
337    public org.apache.reef.webserver.AvroHttpRequest.Builder clearInputStream() {
338      inputStream = null;
339      fieldSetFlags()[4] = false;
340      return this;
341    }
342
343    @Override
344    public AvroHttpRequest build() {
345      try {
346        AvroHttpRequest record = new AvroHttpRequest();
347        record.requestUrl = fieldSetFlags()[0] ? this.requestUrl : (java.lang.CharSequence) defaultValue(fields()[0]);
348        record.pathInfo = fieldSetFlags()[1] ? this.pathInfo : (java.lang.CharSequence) defaultValue(fields()[1]);
349        record.queryString = fieldSetFlags()[2] ? this.queryString : (java.lang.CharSequence) defaultValue(fields()[2]);
350        record.httpMethod = fieldSetFlags()[3] ? this.httpMethod : (java.lang.CharSequence) defaultValue(fields()[3]);
351        record.inputStream = fieldSetFlags()[4] ? this.inputStream : (java.nio.ByteBuffer) defaultValue(fields()[4]);
352        return record;
353      } catch (Exception e) {
354        throw new org.apache.avro.AvroRuntimeException(e);
355      }
356    }
357  }
358}