Back to home page

OSCL-LXR

 
 

    


0001 /**
0002  * Autogenerated by Avro
0003  * 
0004  * DO NOT EDIT DIRECTLY
0005  */
0006 package org.apache.spark.sql.execution.datasources.parquet.test.avro;  
0007 @SuppressWarnings("all")
0008 @org.apache.avro.specific.AvroGenerated
0009 public class Nested extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
0010   public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Nested\",\"namespace\":\"org.apache.spark.sql.execution.datasources.parquet.test.avro\",\"fields\":[{\"name\":\"nested_ints_column\",\"type\":{\"type\":\"array\",\"items\":\"int\"}},{\"name\":\"nested_string_column\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}");
0011   public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
0012   @Deprecated public java.util.List<java.lang.Integer> nested_ints_column;
0013   @Deprecated public java.lang.String nested_string_column;
0014 
0015   /**
0016    * Default constructor.  Note that this does not initialize fields
0017    * to their default values from the schema.  If that is desired then
0018    * one should use <code>newBuilder()</code>. 
0019    */
0020   public Nested() {}
0021 
0022   /**
0023    * All-args constructor.
0024    */
0025   public Nested(java.util.List<java.lang.Integer> nested_ints_column, java.lang.String nested_string_column) {
0026     this.nested_ints_column = nested_ints_column;
0027     this.nested_string_column = nested_string_column;
0028   }
0029 
0030   public org.apache.avro.Schema getSchema() { return SCHEMA$; }
0031   // Used by DatumWriter.  Applications should not call. 
0032   public java.lang.Object get(int field$) {
0033     switch (field$) {
0034     case 0: return nested_ints_column;
0035     case 1: return nested_string_column;
0036     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
0037     }
0038   }
0039   // Used by DatumReader.  Applications should not call. 
0040   @SuppressWarnings(value="unchecked")
0041   public void put(int field$, java.lang.Object value$) {
0042     switch (field$) {
0043     case 0: nested_ints_column = (java.util.List<java.lang.Integer>)value$; break;
0044     case 1: nested_string_column = (java.lang.String)value$; break;
0045     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
0046     }
0047   }
0048 
0049   /**
0050    * Gets the value of the 'nested_ints_column' field.
0051    */
0052   public java.util.List<java.lang.Integer> getNestedIntsColumn() {
0053     return nested_ints_column;
0054   }
0055 
0056   /**
0057    * Sets the value of the 'nested_ints_column' field.
0058    * @param value the value to set.
0059    */
0060   public void setNestedIntsColumn(java.util.List<java.lang.Integer> value) {
0061     this.nested_ints_column = value;
0062   }
0063 
0064   /**
0065    * Gets the value of the 'nested_string_column' field.
0066    */
0067   public java.lang.String getNestedStringColumn() {
0068     return nested_string_column;
0069   }
0070 
0071   /**
0072    * Sets the value of the 'nested_string_column' field.
0073    * @param value the value to set.
0074    */
0075   public void setNestedStringColumn(java.lang.String value) {
0076     this.nested_string_column = value;
0077   }
0078 
0079   /** Creates a new Nested RecordBuilder */
0080   public static org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested.Builder newBuilder() {
0081     return new org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested.Builder();
0082   }
0083   
0084   /** Creates a new Nested RecordBuilder by copying an existing Builder */
0085   public static org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested.Builder newBuilder(org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested.Builder other) {
0086     return new org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested.Builder(other);
0087   }
0088   
0089   /** Creates a new Nested RecordBuilder by copying an existing Nested instance */
0090   public static org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested.Builder newBuilder(org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested other) {
0091     return new org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested.Builder(other);
0092   }
0093   
0094   /**
0095    * RecordBuilder for Nested instances.
0096    */
0097   public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<Nested>
0098     implements org.apache.avro.data.RecordBuilder<Nested> {
0099 
0100     private java.util.List<java.lang.Integer> nested_ints_column;
0101     private java.lang.String nested_string_column;
0102 
0103     /** Creates a new Builder */
0104     private Builder() {
0105       super(org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested.SCHEMA$);
0106     }
0107     
0108     /** Creates a Builder by copying an existing Builder */
0109     private Builder(org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested.Builder other) {
0110       super(other);
0111       if (isValidValue(fields()[0], other.nested_ints_column)) {
0112         this.nested_ints_column = data().deepCopy(fields()[0].schema(), other.nested_ints_column);
0113         fieldSetFlags()[0] = true;
0114       }
0115       if (isValidValue(fields()[1], other.nested_string_column)) {
0116         this.nested_string_column = data().deepCopy(fields()[1].schema(), other.nested_string_column);
0117         fieldSetFlags()[1] = true;
0118       }
0119     }
0120     
0121     /** Creates a Builder by copying an existing Nested instance */
0122     private Builder(org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested other) {
0123             super(org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested.SCHEMA$);
0124       if (isValidValue(fields()[0], other.nested_ints_column)) {
0125         this.nested_ints_column = data().deepCopy(fields()[0].schema(), other.nested_ints_column);
0126         fieldSetFlags()[0] = true;
0127       }
0128       if (isValidValue(fields()[1], other.nested_string_column)) {
0129         this.nested_string_column = data().deepCopy(fields()[1].schema(), other.nested_string_column);
0130         fieldSetFlags()[1] = true;
0131       }
0132     }
0133 
0134     /** Gets the value of the 'nested_ints_column' field */
0135     public java.util.List<java.lang.Integer> getNestedIntsColumn() {
0136       return nested_ints_column;
0137     }
0138     
0139     /** Sets the value of the 'nested_ints_column' field */
0140     public org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested.Builder setNestedIntsColumn(java.util.List<java.lang.Integer> value) {
0141       validate(fields()[0], value);
0142       this.nested_ints_column = value;
0143       fieldSetFlags()[0] = true;
0144       return this; 
0145     }
0146     
0147     /** Checks whether the 'nested_ints_column' field has been set */
0148     public boolean hasNestedIntsColumn() {
0149       return fieldSetFlags()[0];
0150     }
0151     
0152     /** Clears the value of the 'nested_ints_column' field */
0153     public org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested.Builder clearNestedIntsColumn() {
0154       nested_ints_column = null;
0155       fieldSetFlags()[0] = false;
0156       return this;
0157     }
0158 
0159     /** Gets the value of the 'nested_string_column' field */
0160     public java.lang.String getNestedStringColumn() {
0161       return nested_string_column;
0162     }
0163     
0164     /** Sets the value of the 'nested_string_column' field */
0165     public org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested.Builder setNestedStringColumn(java.lang.String value) {
0166       validate(fields()[1], value);
0167       this.nested_string_column = value;
0168       fieldSetFlags()[1] = true;
0169       return this; 
0170     }
0171     
0172     /** Checks whether the 'nested_string_column' field has been set */
0173     public boolean hasNestedStringColumn() {
0174       return fieldSetFlags()[1];
0175     }
0176     
0177     /** Clears the value of the 'nested_string_column' field */
0178     public org.apache.spark.sql.execution.datasources.parquet.test.avro.Nested.Builder clearNestedStringColumn() {
0179       nested_string_column = null;
0180       fieldSetFlags()[1] = false;
0181       return this;
0182     }
0183 
0184     @Override
0185     @SuppressWarnings(value="unchecked")
0186     public Nested build() {
0187       try {
0188         Nested record = new Nested();
0189         record.nested_ints_column = fieldSetFlags()[0] ? this.nested_ints_column : (java.util.List<java.lang.Integer>) defaultValue(fields()[0]);
0190         record.nested_string_column = fieldSetFlags()[1] ? this.nested_string_column : (java.lang.String) defaultValue(fields()[1]);
0191         return record;
0192       } catch (Exception e) {
0193         throw new org.apache.avro.AvroRuntimeException(e);
0194       }
0195     }
0196   }
0197 }