/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package com.esri; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class AvroCoord 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\":\"AvroCoord\",\"namespace\":\"com.esri\",\"fields\":[{\"name\":\"x\",\"type\":\"double\",\"default\":0.0},{\"name\":\"y\",\"type\":\"double\",\"default\":0.0}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } @Deprecated public double x; @Deprecated public double y; /** * Default constructor. */ public AvroCoord() {} /** * All-args constructor. */ public AvroCoord(java.lang.Double x, java.lang.Double y) { this.x = x; this.y = y; } 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 x; case 1: return y; 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: x = (java.lang.Double)value$; break; case 1: y = (java.lang.Double)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'x' field. */ public java.lang.Double getX() { return x; } /** * Sets the value of the 'x' field. * @param value the value to set. */ public void setX(java.lang.Double value) { this.x = value; } /** * Gets the value of the 'y' field. */ public java.lang.Double getY() { return y; } /** * Sets the value of the 'y' field. * @param value the value to set. */ public void setY(java.lang.Double value) { this.y = value; } /** Creates a new AvroCoord RecordBuilder */ public static com.esri.AvroCoord.Builder newBuilder() { return new com.esri.AvroCoord.Builder(); } /** Creates a new AvroCoord RecordBuilder by copying an existing Builder */ public static com.esri.AvroCoord.Builder newBuilder(com.esri.AvroCoord.Builder other) { return new com.esri.AvroCoord.Builder(other); } /** Creates a new AvroCoord RecordBuilder by copying an existing AvroCoord instance */ public static com.esri.AvroCoord.Builder newBuilder(com.esri.AvroCoord other) { return new com.esri.AvroCoord.Builder(other); } /** * RecordBuilder for AvroCoord instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroCoord> implements org.apache.avro.data.RecordBuilder<AvroCoord> { private double x; private double y; /** Creates a new Builder */ private Builder() { super(com.esri.AvroCoord.SCHEMA$); } /** Creates a Builder by copying an existing Builder */ private Builder(com.esri.AvroCoord.Builder other) { super(other); } /** Creates a Builder by copying an existing AvroCoord instance */ private Builder(com.esri.AvroCoord other) { super(com.esri.AvroCoord.SCHEMA$); if (isValidValue(fields()[0], other.x)) { this.x = data().deepCopy(fields()[0].schema(), other.x); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.y)) { this.y = data().deepCopy(fields()[1].schema(), other.y); fieldSetFlags()[1] = true; } } /** Gets the value of the 'x' field */ public java.lang.Double getX() { return x; } /** Sets the value of the 'x' field */ public com.esri.AvroCoord.Builder setX(double value) { validate(fields()[0], value); this.x = value; fieldSetFlags()[0] = true; return this; } /** Checks whether the 'x' field has been set */ public boolean hasX() { return fieldSetFlags()[0]; } /** Clears the value of the 'x' field */ public com.esri.AvroCoord.Builder clearX() { fieldSetFlags()[0] = false; return this; } /** Gets the value of the 'y' field */ public java.lang.Double getY() { return y; } /** Sets the value of the 'y' field */ public com.esri.AvroCoord.Builder setY(double value) { validate(fields()[1], value); this.y = value; fieldSetFlags()[1] = true; return this; } /** Checks whether the 'y' field has been set */ public boolean hasY() { return fieldSetFlags()[1]; } /** Clears the value of the 'y' field */ public com.esri.AvroCoord.Builder clearY() { fieldSetFlags()[1] = false; return this; } @Override public AvroCoord build() { try { AvroCoord record = new AvroCoord(); record.x = fieldSetFlags()[0] ? this.x : (java.lang.Double) defaultValue(fields()[0]); record.y = fieldSetFlags()[1] ? this.y : (java.lang.Double) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }