/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package org.kaaproject.kaa.common.endpoint.gen; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class TopicState 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\":\"TopicState\",\"namespace\":\"org.kaaproject.kaa.common.endpoint.gen\",\"fields\":[{\"name\":\"topicId\",\"type\":\"long\"},{\"name\":\"seqNumber\",\"type\":\"int\"}],\"direction\":\"out\"}"); private long topicId; private int seqNumber; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use {@link \#newBuilder()}. */ public TopicState() { } /** * All-args constructor. */ public TopicState(java.lang.Long topicId, java.lang.Integer seqNumber) { this.topicId = topicId; this.seqNumber = seqNumber; } public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } /** * Creates a new TopicState RecordBuilder */ public static org.kaaproject.kaa.common.endpoint.gen.TopicState.Builder newBuilder() { return new org.kaaproject.kaa.common.endpoint.gen.TopicState.Builder(); } /** * Creates a new TopicState RecordBuilder by copying an existing Builder */ public static org.kaaproject.kaa.common.endpoint.gen.TopicState.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.TopicState.Builder other) { return new org.kaaproject.kaa.common.endpoint.gen.TopicState.Builder(other); } /** * Creates a new TopicState RecordBuilder by copying an existing TopicState instance */ public static org.kaaproject.kaa.common.endpoint.gen.TopicState.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.TopicState other) { return new org.kaaproject.kaa.common.endpoint.gen.TopicState.Builder(other); } 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 topicId; case 1: return seqNumber; 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: topicId = (java.lang.Long) value$; break; case 1: seqNumber = (java.lang.Integer) value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'topicId' field. */ public java.lang.Long getTopicId() { return topicId; } /** * Sets the value of the 'topicId' field. * * @param value the value to set. */ public void setTopicId(java.lang.Long value) { this.topicId = value; } /** * Gets the value of the 'seqNumber' field. */ public java.lang.Integer getSeqNumber() { return seqNumber; } /** * Sets the value of the 'seqNumber' field. * * @param value the value to set. */ public void setSeqNumber(java.lang.Integer value) { this.seqNumber = value; } /** * RecordBuilder for TopicState instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<TopicState> implements org.apache.avro.data.RecordBuilder<TopicState> { private long topicId; private int seqNumber; /** * Creates a new Builder */ private Builder() { super(org.kaaproject.kaa.common.endpoint.gen.TopicState.SCHEMA$); } /** * Creates a Builder by copying an existing Builder */ private Builder(org.kaaproject.kaa.common.endpoint.gen.TopicState.Builder other) { super(other); if (isValidValue(fields()[0], other.topicId)) { this.topicId = data().deepCopy(fields()[0].schema(), other.topicId); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.seqNumber)) { this.seqNumber = data().deepCopy(fields()[1].schema(), other.seqNumber); fieldSetFlags()[1] = true; } } /** * Creates a Builder by copying an existing TopicState instance */ private Builder(org.kaaproject.kaa.common.endpoint.gen.TopicState other) { super(org.kaaproject.kaa.common.endpoint.gen.TopicState.SCHEMA$); if (isValidValue(fields()[0], other.topicId)) { this.topicId = data().deepCopy(fields()[0].schema(), other.topicId); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.seqNumber)) { this.seqNumber = data().deepCopy(fields()[1].schema(), other.seqNumber); fieldSetFlags()[1] = true; } } /** * Gets the value of the 'topicId' field */ public java.lang.Long getTopicId() { return topicId; } /** * Sets the value of the 'topicId' field */ public org.kaaproject.kaa.common.endpoint.gen.TopicState.Builder setTopicId(long value) { validate(fields()[0], value); this.topicId = value; fieldSetFlags()[0] = true; return this; } /** * Checks whether the 'topicId' field has been set */ public boolean hasTopicId() { return fieldSetFlags()[0]; } /** * Clears the value of the 'topicId' field */ public org.kaaproject.kaa.common.endpoint.gen.TopicState.Builder clearTopicId() { fieldSetFlags()[0] = false; return this; } /** * Gets the value of the 'seqNumber' field */ public java.lang.Integer getSeqNumber() { return seqNumber; } /** * Sets the value of the 'seqNumber' field */ public org.kaaproject.kaa.common.endpoint.gen.TopicState.Builder setSeqNumber(int value) { validate(fields()[1], value); this.seqNumber = value; fieldSetFlags()[1] = true; return this; } /** * Checks whether the 'seqNumber' field has been set */ public boolean hasSeqNumber() { return fieldSetFlags()[1]; } /** * Clears the value of the 'seqNumber' field */ public org.kaaproject.kaa.common.endpoint.gen.TopicState.Builder clearSeqNumber() { fieldSetFlags()[1] = false; return this; } @Override public TopicState build() { try { TopicState record = new TopicState(); record.topicId = fieldSetFlags()[0] ? this.topicId : (java.lang.Long) defaultValue(fields()[0]); record.seqNumber = fieldSetFlags()[1] ? this.seqNumber : (java.lang.Integer) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }