/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package com.freedomotic.plugins.devices.persistence.model.avro; import org.apache.avro.specific.SpecificData; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class FreedomoticData extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { private static final long serialVersionUID = -8262595000152910239L; public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"FreedomoticData\",\"namespace\":\"com.freedomotic.plugins.devices.persistence.model.avro\",\"fields\":[{\"name\":\"name\",\"type\":[\"string\",\"null\"]},{\"name\":\"uuid\",\"type\":\"string\"},{\"name\":\"datetime\",\"type\":\"long\"},{\"name\":\"properties\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"Property\",\"fields\":[{\"name\":\"key\",\"type\":\"string\"},{\"name\":\"value\",\"type\":[\"string\",\"null\"]}]}}}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } @Deprecated public java.lang.CharSequence name; @Deprecated public java.lang.CharSequence uuid; @Deprecated public long datetime; @Deprecated public java.util.List<com.freedomotic.plugins.devices.persistence.model.avro.Property> properties; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use <code>newBuilder()</code>. */ public FreedomoticData() {} /** * All-args constructor. * @param name The new value for name * @param uuid The new value for uuid * @param datetime The new value for datetime * @param properties The new value for properties */ public FreedomoticData(java.lang.CharSequence name, java.lang.CharSequence uuid, java.lang.Long datetime, java.util.List<com.freedomotic.plugins.devices.persistence.model.avro.Property> properties) { this.name = name; this.uuid = uuid; this.datetime = datetime; this.properties = properties; } 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 name; case 1: return uuid; case 2: return datetime; case 3: return properties; 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: name = (java.lang.CharSequence)value$; break; case 1: uuid = (java.lang.CharSequence)value$; break; case 2: datetime = (java.lang.Long)value$; break; case 3: properties = (java.util.List<com.freedomotic.plugins.devices.persistence.model.avro.Property>)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'name' field. * @return The value of the 'name' field. */ public java.lang.CharSequence getName() { return name; } /** * Sets the value of the 'name' field. * @param value the value to set. */ public void setName(java.lang.CharSequence value) { this.name = value; } /** * Gets the value of the 'uuid' field. * @return The value of the 'uuid' field. */ public java.lang.CharSequence getUuid() { return uuid; } /** * Sets the value of the 'uuid' field. * @param value the value to set. */ public void setUuid(java.lang.CharSequence value) { this.uuid = value; } /** * Gets the value of the 'datetime' field. * @return The value of the 'datetime' field. */ public java.lang.Long getDatetime() { return datetime; } /** * Sets the value of the 'datetime' field. * @param value the value to set. */ public void setDatetime(java.lang.Long value) { this.datetime = value; } /** * Gets the value of the 'properties' field. * @return The value of the 'properties' field. */ public java.util.List<com.freedomotic.plugins.devices.persistence.model.avro.Property> getProperties() { return properties; } /** * Sets the value of the 'properties' field. * @param value the value to set. */ public void setProperties(java.util.List<com.freedomotic.plugins.devices.persistence.model.avro.Property> value) { this.properties = value; } /** * Creates a new FreedomoticData RecordBuilder. * @return A new FreedomoticData RecordBuilder */ public static com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder newBuilder() { return new com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder(); } /** * Creates a new FreedomoticData RecordBuilder by copying an existing Builder. * @param other The existing builder to copy. * @return A new FreedomoticData RecordBuilder */ public static com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder newBuilder(com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder other) { return new com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder(other); } /** * Creates a new FreedomoticData RecordBuilder by copying an existing FreedomoticData instance. * @param other The existing instance to copy. * @return A new FreedomoticData RecordBuilder */ public static com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder newBuilder(com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData other) { return new com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder(other); } /** * RecordBuilder for FreedomoticData instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<FreedomoticData> implements org.apache.avro.data.RecordBuilder<FreedomoticData> { private java.lang.CharSequence name; private java.lang.CharSequence uuid; private long datetime; private java.util.List<com.freedomotic.plugins.devices.persistence.model.avro.Property> properties; /** Creates a new Builder */ private Builder() { super(SCHEMA$); } /** * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ private Builder(com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder other) { super(other); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.uuid)) { this.uuid = data().deepCopy(fields()[1].schema(), other.uuid); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.datetime)) { this.datetime = data().deepCopy(fields()[2].schema(), other.datetime); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.properties)) { this.properties = data().deepCopy(fields()[3].schema(), other.properties); fieldSetFlags()[3] = true; } } /** * Creates a Builder by copying an existing FreedomoticData instance * @param other The existing instance to copy. */ private Builder(com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData other) { super(SCHEMA$); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.uuid)) { this.uuid = data().deepCopy(fields()[1].schema(), other.uuid); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.datetime)) { this.datetime = data().deepCopy(fields()[2].schema(), other.datetime); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.properties)) { this.properties = data().deepCopy(fields()[3].schema(), other.properties); fieldSetFlags()[3] = true; } } /** * Gets the value of the 'name' field. * @return The value. */ public java.lang.CharSequence getName() { return name; } /** * Sets the value of the 'name' field. * @param value The value of 'name'. * @return This builder. */ public com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder setName(java.lang.CharSequence value) { validate(fields()[0], value); this.name = value; fieldSetFlags()[0] = true; return this; } /** * Checks whether the 'name' field has been set. * @return True if the 'name' field has been set, false otherwise. */ public boolean hasName() { return fieldSetFlags()[0]; } /** * Clears the value of the 'name' field. * @return This builder. */ public com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder clearName() { name = null; fieldSetFlags()[0] = false; return this; } /** * Gets the value of the 'uuid' field. * @return The value. */ public java.lang.CharSequence getUuid() { return uuid; } /** * Sets the value of the 'uuid' field. * @param value The value of 'uuid'. * @return This builder. */ public com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder setUuid(java.lang.CharSequence value) { validate(fields()[1], value); this.uuid = value; fieldSetFlags()[1] = true; return this; } /** * Checks whether the 'uuid' field has been set. * @return True if the 'uuid' field has been set, false otherwise. */ public boolean hasUuid() { return fieldSetFlags()[1]; } /** * Clears the value of the 'uuid' field. * @return This builder. */ public com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder clearUuid() { uuid = null; fieldSetFlags()[1] = false; return this; } /** * Gets the value of the 'datetime' field. * @return The value. */ public java.lang.Long getDatetime() { return datetime; } /** * Sets the value of the 'datetime' field. * @param value The value of 'datetime'. * @return This builder. */ public com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder setDatetime(long value) { validate(fields()[2], value); this.datetime = value; fieldSetFlags()[2] = true; return this; } /** * Checks whether the 'datetime' field has been set. * @return True if the 'datetime' field has been set, false otherwise. */ public boolean hasDatetime() { return fieldSetFlags()[2]; } /** * Clears the value of the 'datetime' field. * @return This builder. */ public com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder clearDatetime() { fieldSetFlags()[2] = false; return this; } /** * Gets the value of the 'properties' field. * @return The value. */ public java.util.List<com.freedomotic.plugins.devices.persistence.model.avro.Property> getProperties() { return properties; } /** * Sets the value of the 'properties' field. * @param value The value of 'properties'. * @return This builder. */ public com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder setProperties(java.util.List<com.freedomotic.plugins.devices.persistence.model.avro.Property> value) { validate(fields()[3], value); this.properties = value; fieldSetFlags()[3] = true; return this; } /** * Checks whether the 'properties' field has been set. * @return True if the 'properties' field has been set, false otherwise. */ public boolean hasProperties() { return fieldSetFlags()[3]; } /** * Clears the value of the 'properties' field. * @return This builder. */ public com.freedomotic.plugins.devices.persistence.model.avro.FreedomoticData.Builder clearProperties() { properties = null; fieldSetFlags()[3] = false; return this; } @Override public FreedomoticData build() { try { FreedomoticData record = new FreedomoticData(); record.name = fieldSetFlags()[0] ? this.name : (java.lang.CharSequence) defaultValue(fields()[0]); record.uuid = fieldSetFlags()[1] ? this.uuid : (java.lang.CharSequence) defaultValue(fields()[1]); record.datetime = fieldSetFlags()[2] ? this.datetime : (java.lang.Long) defaultValue(fields()[2]); record.properties = fieldSetFlags()[3] ? this.properties : (java.util.List<com.freedomotic.plugins.devices.persistence.model.avro.Property>) defaultValue(fields()[3]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } private static final org.apache.avro.io.DatumWriter WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$); @Override public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException { WRITER$.write(this, SpecificData.getEncoder(out)); } private static final org.apache.avro.io.DatumReader READER$ = new org.apache.avro.specific.SpecificDatumReader(SCHEMA$); @Override public void readExternal(java.io.ObjectInput in) throws java.io.IOException { READER$.read(this, SpecificData.getDecoder(in)); } }