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 AvroPrimitives 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\":\"AvroPrimitives\",\"namespace\":\"org.apache.spark.sql.execution.datasources.parquet.test.avro\",\"fields\":[{\"name\":\"bool_column\",\"type\":\"boolean\"},{\"name\":\"int_column\",\"type\":\"int\"},{\"name\":\"long_column\",\"type\":\"long\"},{\"name\":\"float_column\",\"type\":\"float\"},{\"name\":\"double_column\",\"type\":\"double\"},{\"name\":\"binary_column\",\"type\":\"bytes\"},{\"name\":\"string_column\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}");
0011   public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
0012   @Deprecated public boolean bool_column;
0013   @Deprecated public int int_column;
0014   @Deprecated public long long_column;
0015   @Deprecated public float float_column;
0016   @Deprecated public double double_column;
0017   @Deprecated public java.nio.ByteBuffer binary_column;
0018   @Deprecated public java.lang.String string_column;
0019 
0020   /**
0021    * Default constructor.  Note that this does not initialize fields
0022    * to their default values from the schema.  If that is desired then
0023    * one should use <code>newBuilder()</code>. 
0024    */
0025   public AvroPrimitives() {}
0026 
0027   /**
0028    * All-args constructor.
0029    */
0030   public AvroPrimitives(java.lang.Boolean bool_column, java.lang.Integer int_column, java.lang.Long long_column, java.lang.Float float_column, java.lang.Double double_column, java.nio.ByteBuffer binary_column, java.lang.String string_column) {
0031     this.bool_column = bool_column;
0032     this.int_column = int_column;
0033     this.long_column = long_column;
0034     this.float_column = float_column;
0035     this.double_column = double_column;
0036     this.binary_column = binary_column;
0037     this.string_column = string_column;
0038   }
0039 
0040   public org.apache.avro.Schema getSchema() { return SCHEMA$; }
0041   // Used by DatumWriter.  Applications should not call. 
0042   public java.lang.Object get(int field$) {
0043     switch (field$) {
0044     case 0: return bool_column;
0045     case 1: return int_column;
0046     case 2: return long_column;
0047     case 3: return float_column;
0048     case 4: return double_column;
0049     case 5: return binary_column;
0050     case 6: return string_column;
0051     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
0052     }
0053   }
0054   // Used by DatumReader.  Applications should not call. 
0055   @SuppressWarnings(value="unchecked")
0056   public void put(int field$, java.lang.Object value$) {
0057     switch (field$) {
0058     case 0: bool_column = (java.lang.Boolean)value$; break;
0059     case 1: int_column = (java.lang.Integer)value$; break;
0060     case 2: long_column = (java.lang.Long)value$; break;
0061     case 3: float_column = (java.lang.Float)value$; break;
0062     case 4: double_column = (java.lang.Double)value$; break;
0063     case 5: binary_column = (java.nio.ByteBuffer)value$; break;
0064     case 6: string_column = (java.lang.String)value$; break;
0065     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
0066     }
0067   }
0068 
0069   /**
0070    * Gets the value of the 'bool_column' field.
0071    */
0072   public java.lang.Boolean getBoolColumn() {
0073     return bool_column;
0074   }
0075 
0076   /**
0077    * Sets the value of the 'bool_column' field.
0078    * @param value the value to set.
0079    */
0080   public void setBoolColumn(java.lang.Boolean value) {
0081     this.bool_column = value;
0082   }
0083 
0084   /**
0085    * Gets the value of the 'int_column' field.
0086    */
0087   public java.lang.Integer getIntColumn() {
0088     return int_column;
0089   }
0090 
0091   /**
0092    * Sets the value of the 'int_column' field.
0093    * @param value the value to set.
0094    */
0095   public void setIntColumn(java.lang.Integer value) {
0096     this.int_column = value;
0097   }
0098 
0099   /**
0100    * Gets the value of the 'long_column' field.
0101    */
0102   public java.lang.Long getLongColumn() {
0103     return long_column;
0104   }
0105 
0106   /**
0107    * Sets the value of the 'long_column' field.
0108    * @param value the value to set.
0109    */
0110   public void setLongColumn(java.lang.Long value) {
0111     this.long_column = value;
0112   }
0113 
0114   /**
0115    * Gets the value of the 'float_column' field.
0116    */
0117   public java.lang.Float getFloatColumn() {
0118     return float_column;
0119   }
0120 
0121   /**
0122    * Sets the value of the 'float_column' field.
0123    * @param value the value to set.
0124    */
0125   public void setFloatColumn(java.lang.Float value) {
0126     this.float_column = value;
0127   }
0128 
0129   /**
0130    * Gets the value of the 'double_column' field.
0131    */
0132   public java.lang.Double getDoubleColumn() {
0133     return double_column;
0134   }
0135 
0136   /**
0137    * Sets the value of the 'double_column' field.
0138    * @param value the value to set.
0139    */
0140   public void setDoubleColumn(java.lang.Double value) {
0141     this.double_column = value;
0142   }
0143 
0144   /**
0145    * Gets the value of the 'binary_column' field.
0146    */
0147   public java.nio.ByteBuffer getBinaryColumn() {
0148     return binary_column;
0149   }
0150 
0151   /**
0152    * Sets the value of the 'binary_column' field.
0153    * @param value the value to set.
0154    */
0155   public void setBinaryColumn(java.nio.ByteBuffer value) {
0156     this.binary_column = value;
0157   }
0158 
0159   /**
0160    * Gets the value of the 'string_column' field.
0161    */
0162   public java.lang.String getStringColumn() {
0163     return string_column;
0164   }
0165 
0166   /**
0167    * Sets the value of the 'string_column' field.
0168    * @param value the value to set.
0169    */
0170   public void setStringColumn(java.lang.String value) {
0171     this.string_column = value;
0172   }
0173 
0174   /** Creates a new AvroPrimitives RecordBuilder */
0175   public static org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder newBuilder() {
0176     return new org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder();
0177   }
0178   
0179   /** Creates a new AvroPrimitives RecordBuilder by copying an existing Builder */
0180   public static org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder newBuilder(org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder other) {
0181     return new org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder(other);
0182   }
0183   
0184   /** Creates a new AvroPrimitives RecordBuilder by copying an existing AvroPrimitives instance */
0185   public static org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder newBuilder(org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives other) {
0186     return new org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder(other);
0187   }
0188   
0189   /**
0190    * RecordBuilder for AvroPrimitives instances.
0191    */
0192   public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroPrimitives>
0193     implements org.apache.avro.data.RecordBuilder<AvroPrimitives> {
0194 
0195     private boolean bool_column;
0196     private int int_column;
0197     private long long_column;
0198     private float float_column;
0199     private double double_column;
0200     private java.nio.ByteBuffer binary_column;
0201     private java.lang.String string_column;
0202 
0203     /** Creates a new Builder */
0204     private Builder() {
0205       super(org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.SCHEMA$);
0206     }
0207     
0208     /** Creates a Builder by copying an existing Builder */
0209     private Builder(org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder other) {
0210       super(other);
0211       if (isValidValue(fields()[0], other.bool_column)) {
0212         this.bool_column = data().deepCopy(fields()[0].schema(), other.bool_column);
0213         fieldSetFlags()[0] = true;
0214       }
0215       if (isValidValue(fields()[1], other.int_column)) {
0216         this.int_column = data().deepCopy(fields()[1].schema(), other.int_column);
0217         fieldSetFlags()[1] = true;
0218       }
0219       if (isValidValue(fields()[2], other.long_column)) {
0220         this.long_column = data().deepCopy(fields()[2].schema(), other.long_column);
0221         fieldSetFlags()[2] = true;
0222       }
0223       if (isValidValue(fields()[3], other.float_column)) {
0224         this.float_column = data().deepCopy(fields()[3].schema(), other.float_column);
0225         fieldSetFlags()[3] = true;
0226       }
0227       if (isValidValue(fields()[4], other.double_column)) {
0228         this.double_column = data().deepCopy(fields()[4].schema(), other.double_column);
0229         fieldSetFlags()[4] = true;
0230       }
0231       if (isValidValue(fields()[5], other.binary_column)) {
0232         this.binary_column = data().deepCopy(fields()[5].schema(), other.binary_column);
0233         fieldSetFlags()[5] = true;
0234       }
0235       if (isValidValue(fields()[6], other.string_column)) {
0236         this.string_column = data().deepCopy(fields()[6].schema(), other.string_column);
0237         fieldSetFlags()[6] = true;
0238       }
0239     }
0240     
0241     /** Creates a Builder by copying an existing AvroPrimitives instance */
0242     private Builder(org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives other) {
0243             super(org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.SCHEMA$);
0244       if (isValidValue(fields()[0], other.bool_column)) {
0245         this.bool_column = data().deepCopy(fields()[0].schema(), other.bool_column);
0246         fieldSetFlags()[0] = true;
0247       }
0248       if (isValidValue(fields()[1], other.int_column)) {
0249         this.int_column = data().deepCopy(fields()[1].schema(), other.int_column);
0250         fieldSetFlags()[1] = true;
0251       }
0252       if (isValidValue(fields()[2], other.long_column)) {
0253         this.long_column = data().deepCopy(fields()[2].schema(), other.long_column);
0254         fieldSetFlags()[2] = true;
0255       }
0256       if (isValidValue(fields()[3], other.float_column)) {
0257         this.float_column = data().deepCopy(fields()[3].schema(), other.float_column);
0258         fieldSetFlags()[3] = true;
0259       }
0260       if (isValidValue(fields()[4], other.double_column)) {
0261         this.double_column = data().deepCopy(fields()[4].schema(), other.double_column);
0262         fieldSetFlags()[4] = true;
0263       }
0264       if (isValidValue(fields()[5], other.binary_column)) {
0265         this.binary_column = data().deepCopy(fields()[5].schema(), other.binary_column);
0266         fieldSetFlags()[5] = true;
0267       }
0268       if (isValidValue(fields()[6], other.string_column)) {
0269         this.string_column = data().deepCopy(fields()[6].schema(), other.string_column);
0270         fieldSetFlags()[6] = true;
0271       }
0272     }
0273 
0274     /** Gets the value of the 'bool_column' field */
0275     public java.lang.Boolean getBoolColumn() {
0276       return bool_column;
0277     }
0278     
0279     /** Sets the value of the 'bool_column' field */
0280     public org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder setBoolColumn(boolean value) {
0281       validate(fields()[0], value);
0282       this.bool_column = value;
0283       fieldSetFlags()[0] = true;
0284       return this; 
0285     }
0286     
0287     /** Checks whether the 'bool_column' field has been set */
0288     public boolean hasBoolColumn() {
0289       return fieldSetFlags()[0];
0290     }
0291     
0292     /** Clears the value of the 'bool_column' field */
0293     public org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder clearBoolColumn() {
0294       fieldSetFlags()[0] = false;
0295       return this;
0296     }
0297 
0298     /** Gets the value of the 'int_column' field */
0299     public java.lang.Integer getIntColumn() {
0300       return int_column;
0301     }
0302     
0303     /** Sets the value of the 'int_column' field */
0304     public org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder setIntColumn(int value) {
0305       validate(fields()[1], value);
0306       this.int_column = value;
0307       fieldSetFlags()[1] = true;
0308       return this; 
0309     }
0310     
0311     /** Checks whether the 'int_column' field has been set */
0312     public boolean hasIntColumn() {
0313       return fieldSetFlags()[1];
0314     }
0315     
0316     /** Clears the value of the 'int_column' field */
0317     public org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder clearIntColumn() {
0318       fieldSetFlags()[1] = false;
0319       return this;
0320     }
0321 
0322     /** Gets the value of the 'long_column' field */
0323     public java.lang.Long getLongColumn() {
0324       return long_column;
0325     }
0326     
0327     /** Sets the value of the 'long_column' field */
0328     public org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder setLongColumn(long value) {
0329       validate(fields()[2], value);
0330       this.long_column = value;
0331       fieldSetFlags()[2] = true;
0332       return this; 
0333     }
0334     
0335     /** Checks whether the 'long_column' field has been set */
0336     public boolean hasLongColumn() {
0337       return fieldSetFlags()[2];
0338     }
0339     
0340     /** Clears the value of the 'long_column' field */
0341     public org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder clearLongColumn() {
0342       fieldSetFlags()[2] = false;
0343       return this;
0344     }
0345 
0346     /** Gets the value of the 'float_column' field */
0347     public java.lang.Float getFloatColumn() {
0348       return float_column;
0349     }
0350     
0351     /** Sets the value of the 'float_column' field */
0352     public org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder setFloatColumn(float value) {
0353       validate(fields()[3], value);
0354       this.float_column = value;
0355       fieldSetFlags()[3] = true;
0356       return this; 
0357     }
0358     
0359     /** Checks whether the 'float_column' field has been set */
0360     public boolean hasFloatColumn() {
0361       return fieldSetFlags()[3];
0362     }
0363     
0364     /** Clears the value of the 'float_column' field */
0365     public org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder clearFloatColumn() {
0366       fieldSetFlags()[3] = false;
0367       return this;
0368     }
0369 
0370     /** Gets the value of the 'double_column' field */
0371     public java.lang.Double getDoubleColumn() {
0372       return double_column;
0373     }
0374     
0375     /** Sets the value of the 'double_column' field */
0376     public org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder setDoubleColumn(double value) {
0377       validate(fields()[4], value);
0378       this.double_column = value;
0379       fieldSetFlags()[4] = true;
0380       return this; 
0381     }
0382     
0383     /** Checks whether the 'double_column' field has been set */
0384     public boolean hasDoubleColumn() {
0385       return fieldSetFlags()[4];
0386     }
0387     
0388     /** Clears the value of the 'double_column' field */
0389     public org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder clearDoubleColumn() {
0390       fieldSetFlags()[4] = false;
0391       return this;
0392     }
0393 
0394     /** Gets the value of the 'binary_column' field */
0395     public java.nio.ByteBuffer getBinaryColumn() {
0396       return binary_column;
0397     }
0398     
0399     /** Sets the value of the 'binary_column' field */
0400     public org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder setBinaryColumn(java.nio.ByteBuffer value) {
0401       validate(fields()[5], value);
0402       this.binary_column = value;
0403       fieldSetFlags()[5] = true;
0404       return this; 
0405     }
0406     
0407     /** Checks whether the 'binary_column' field has been set */
0408     public boolean hasBinaryColumn() {
0409       return fieldSetFlags()[5];
0410     }
0411     
0412     /** Clears the value of the 'binary_column' field */
0413     public org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder clearBinaryColumn() {
0414       binary_column = null;
0415       fieldSetFlags()[5] = false;
0416       return this;
0417     }
0418 
0419     /** Gets the value of the 'string_column' field */
0420     public java.lang.String getStringColumn() {
0421       return string_column;
0422     }
0423     
0424     /** Sets the value of the 'string_column' field */
0425     public org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder setStringColumn(java.lang.String value) {
0426       validate(fields()[6], value);
0427       this.string_column = value;
0428       fieldSetFlags()[6] = true;
0429       return this; 
0430     }
0431     
0432     /** Checks whether the 'string_column' field has been set */
0433     public boolean hasStringColumn() {
0434       return fieldSetFlags()[6];
0435     }
0436     
0437     /** Clears the value of the 'string_column' field */
0438     public org.apache.spark.sql.execution.datasources.parquet.test.avro.AvroPrimitives.Builder clearStringColumn() {
0439       string_column = null;
0440       fieldSetFlags()[6] = false;
0441       return this;
0442     }
0443 
0444     @Override
0445     public AvroPrimitives build() {
0446       try {
0447         AvroPrimitives record = new AvroPrimitives();
0448         record.bool_column = fieldSetFlags()[0] ? this.bool_column : (java.lang.Boolean) defaultValue(fields()[0]);
0449         record.int_column = fieldSetFlags()[1] ? this.int_column : (java.lang.Integer) defaultValue(fields()[1]);
0450         record.long_column = fieldSetFlags()[2] ? this.long_column : (java.lang.Long) defaultValue(fields()[2]);
0451         record.float_column = fieldSetFlags()[3] ? this.float_column : (java.lang.Float) defaultValue(fields()[3]);
0452         record.double_column = fieldSetFlags()[4] ? this.double_column : (java.lang.Double) defaultValue(fields()[4]);
0453         record.binary_column = fieldSetFlags()[5] ? this.binary_column : (java.nio.ByteBuffer) defaultValue(fields()[5]);
0454         record.string_column = fieldSetFlags()[6] ? this.string_column : (java.lang.String) defaultValue(fields()[6]);
0455         return record;
0456       } catch (Exception e) {
0457         throw new org.apache.avro.AvroRuntimeException(e);
0458       }
0459     }
0460   }
0461 }