/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package com.esri; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class AvroPoint 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\":\"AvroPoint\",\"namespace\":\"com.esri\",\"fields\":[{\"name\":\"spatialReference\",\"type\":{\"type\":\"record\",\"name\":\"AvroSpatialReference\",\"fields\":[{\"name\":\"wkid\",\"type\":\"int\",\"default\":4326}]}},{\"name\":\"coord\",\"type\":{\"type\":\"record\",\"name\":\"AvroCoord\",\"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 com.esri.AvroSpatialReference spatialReference; @Deprecated public com.esri.AvroCoord coord; /** * Default constructor. */ public AvroPoint() {} /** * All-args constructor. */ public AvroPoint(com.esri.AvroSpatialReference spatialReference, com.esri.AvroCoord coord) { this.spatialReference = spatialReference; this.coord = coord; } 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 spatialReference; case 1: return coord; 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: spatialReference = (com.esri.AvroSpatialReference)value$; break; case 1: coord = (com.esri.AvroCoord)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'spatialReference' field. */ public com.esri.AvroSpatialReference getSpatialReference() { return spatialReference; } /** * Sets the value of the 'spatialReference' field. * @param value the value to set. */ public void setSpatialReference(com.esri.AvroSpatialReference value) { this.spatialReference = value; } /** * Gets the value of the 'coord' field. */ public com.esri.AvroCoord getCoord() { return coord; } /** * Sets the value of the 'coord' field. * @param value the value to set. */ public void setCoord(com.esri.AvroCoord value) { this.coord = value; } /** Creates a new AvroPoint RecordBuilder */ public static com.esri.AvroPoint.Builder newBuilder() { return new com.esri.AvroPoint.Builder(); } /** Creates a new AvroPoint RecordBuilder by copying an existing Builder */ public static com.esri.AvroPoint.Builder newBuilder(com.esri.AvroPoint.Builder other) { return new com.esri.AvroPoint.Builder(other); } /** Creates a new AvroPoint RecordBuilder by copying an existing AvroPoint instance */ public static com.esri.AvroPoint.Builder newBuilder(com.esri.AvroPoint other) { return new com.esri.AvroPoint.Builder(other); } /** * RecordBuilder for AvroPoint instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroPoint> implements org.apache.avro.data.RecordBuilder<AvroPoint> { private com.esri.AvroSpatialReference spatialReference; private com.esri.AvroCoord coord; /** Creates a new Builder */ private Builder() { super(com.esri.AvroPoint.SCHEMA$); } /** Creates a Builder by copying an existing Builder */ private Builder(com.esri.AvroPoint.Builder other) { super(other); } /** Creates a Builder by copying an existing AvroPoint instance */ private Builder(com.esri.AvroPoint other) { super(com.esri.AvroPoint.SCHEMA$); if (isValidValue(fields()[0], other.spatialReference)) { this.spatialReference = data().deepCopy(fields()[0].schema(), other.spatialReference); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.coord)) { this.coord = data().deepCopy(fields()[1].schema(), other.coord); fieldSetFlags()[1] = true; } } /** Gets the value of the 'spatialReference' field */ public com.esri.AvroSpatialReference getSpatialReference() { return spatialReference; } /** Sets the value of the 'spatialReference' field */ public com.esri.AvroPoint.Builder setSpatialReference(com.esri.AvroSpatialReference value) { validate(fields()[0], value); this.spatialReference = value; fieldSetFlags()[0] = true; return this; } /** Checks whether the 'spatialReference' field has been set */ public boolean hasSpatialReference() { return fieldSetFlags()[0]; } /** Clears the value of the 'spatialReference' field */ public com.esri.AvroPoint.Builder clearSpatialReference() { spatialReference = null; fieldSetFlags()[0] = false; return this; } /** Gets the value of the 'coord' field */ public com.esri.AvroCoord getCoord() { return coord; } /** Sets the value of the 'coord' field */ public com.esri.AvroPoint.Builder setCoord(com.esri.AvroCoord value) { validate(fields()[1], value); this.coord = value; fieldSetFlags()[1] = true; return this; } /** Checks whether the 'coord' field has been set */ public boolean hasCoord() { return fieldSetFlags()[1]; } /** Clears the value of the 'coord' field */ public com.esri.AvroPoint.Builder clearCoord() { coord = null; fieldSetFlags()[1] = false; return this; } @Override public AvroPoint build() { try { AvroPoint record = new AvroPoint(); record.spatialReference = fieldSetFlags()[0] ? this.spatialReference : (com.esri.AvroSpatialReference) defaultValue(fields()[0]); record.coord = fieldSetFlags()[1] ? this.coord : (com.esri.AvroCoord) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }