/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package org.kaaproject.kaa.common.endpoint.gen; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class Event 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\":\"Event\",\"namespace\":\"org.kaaproject.kaa.common.endpoint.gen\",\"fields\":[{\"name\":\"seqNum\",\"type\":\"int\"},{\"name\":\"eventClassFQN\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"eventData\",\"type\":\"bytes\"},{\"name\":\"source\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"},\"null\"]},{\"name\":\"target\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"},\"null\"]}]}"); private int seqNum; private java.lang.String eventClassFQN; private java.nio.ByteBuffer eventData; private java.lang.String source; private java.lang.String target; /** * 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 Event() { } /** * All-args constructor. */ public Event(java.lang.Integer seqNum, java.lang.String eventClassFQN, java.nio.ByteBuffer eventData, java.lang.String source, java.lang.String target) { this.seqNum = seqNum; this.eventClassFQN = eventClassFQN; this.eventData = eventData; this.source = source; this.target = target; } public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } /** * Creates a new Event RecordBuilder */ public static org.kaaproject.kaa.common.endpoint.gen.Event.Builder newBuilder() { return new org.kaaproject.kaa.common.endpoint.gen.Event.Builder(); } /** * Creates a new Event RecordBuilder by copying an existing Builder */ public static org.kaaproject.kaa.common.endpoint.gen.Event.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.Event.Builder other) { return new org.kaaproject.kaa.common.endpoint.gen.Event.Builder(other); } /** * Creates a new Event RecordBuilder by copying an existing Event instance */ public static org.kaaproject.kaa.common.endpoint.gen.Event.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.Event other) { return new org.kaaproject.kaa.common.endpoint.gen.Event.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 seqNum; case 1: return eventClassFQN; case 2: return eventData; case 3: return source; case 4: return target; 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: seqNum = (java.lang.Integer) value$; break; case 1: eventClassFQN = (java.lang.String) value$; break; case 2: eventData = (java.nio.ByteBuffer) value$; break; case 3: source = (java.lang.String) value$; break; case 4: target = (java.lang.String) value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'seqNum' field. */ public java.lang.Integer getSeqNum() { return seqNum; } /** * Sets the value of the 'seqNum' field. * * @param value the value to set. */ public void setSeqNum(java.lang.Integer value) { this.seqNum = value; } /** * Gets the value of the 'eventClassFQN' field. */ public java.lang.String getEventClassFQN() { return eventClassFQN; } /** * Sets the value of the 'eventClassFQN' field. * * @param value the value to set. */ public void setEventClassFQN(java.lang.String value) { this.eventClassFQN = value; } /** * Gets the value of the 'eventData' field. */ public java.nio.ByteBuffer getEventData() { return eventData; } /** * Sets the value of the 'eventData' field. * * @param value the value to set. */ public void setEventData(java.nio.ByteBuffer value) { this.eventData = value; } /** * Gets the value of the 'source' field. */ public java.lang.String getSource() { return source; } /** * Sets the value of the 'source' field. * * @param value the value to set. */ public void setSource(java.lang.String value) { this.source = value; } /** * Gets the value of the 'target' field. */ public java.lang.String getTarget() { return target; } /** * Sets the value of the 'target' field. * * @param value the value to set. */ public void setTarget(java.lang.String value) { this.target = value; } /** * RecordBuilder for Event instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<Event> implements org.apache.avro.data.RecordBuilder<Event> { private int seqNum; private java.lang.String eventClassFQN; private java.nio.ByteBuffer eventData; private java.lang.String source; private java.lang.String target; /** * Creates a new Builder */ private Builder() { super(org.kaaproject.kaa.common.endpoint.gen.Event.SCHEMA$); } /** * Creates a Builder by copying an existing Builder */ private Builder(org.kaaproject.kaa.common.endpoint.gen.Event.Builder other) { super(other); if (isValidValue(fields()[0], other.seqNum)) { this.seqNum = data().deepCopy(fields()[0].schema(), other.seqNum); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.eventClassFQN)) { this.eventClassFQN = data().deepCopy(fields()[1].schema(), other.eventClassFQN); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.eventData)) { this.eventData = data().deepCopy(fields()[2].schema(), other.eventData); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.source)) { this.source = data().deepCopy(fields()[3].schema(), other.source); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.target)) { this.target = data().deepCopy(fields()[4].schema(), other.target); fieldSetFlags()[4] = true; } } /** * Creates a Builder by copying an existing Event instance */ private Builder(org.kaaproject.kaa.common.endpoint.gen.Event other) { super(org.kaaproject.kaa.common.endpoint.gen.Event.SCHEMA$); if (isValidValue(fields()[0], other.seqNum)) { this.seqNum = data().deepCopy(fields()[0].schema(), other.seqNum); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.eventClassFQN)) { this.eventClassFQN = data().deepCopy(fields()[1].schema(), other.eventClassFQN); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.eventData)) { this.eventData = data().deepCopy(fields()[2].schema(), other.eventData); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.source)) { this.source = data().deepCopy(fields()[3].schema(), other.source); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.target)) { this.target = data().deepCopy(fields()[4].schema(), other.target); fieldSetFlags()[4] = true; } } /** * Gets the value of the 'seqNum' field */ public java.lang.Integer getSeqNum() { return seqNum; } /** * Sets the value of the 'seqNum' field */ public org.kaaproject.kaa.common.endpoint.gen.Event.Builder setSeqNum(int value) { validate(fields()[0], value); this.seqNum = value; fieldSetFlags()[0] = true; return this; } /** * Checks whether the 'seqNum' field has been set */ public boolean hasSeqNum() { return fieldSetFlags()[0]; } /** * Clears the value of the 'seqNum' field */ public org.kaaproject.kaa.common.endpoint.gen.Event.Builder clearSeqNum() { fieldSetFlags()[0] = false; return this; } /** * Gets the value of the 'eventClassFQN' field */ public java.lang.String getEventClassFQN() { return eventClassFQN; } /** * Sets the value of the 'eventClassFQN' field */ public org.kaaproject.kaa.common.endpoint.gen.Event.Builder setEventClassFQN(java.lang.String value) { validate(fields()[1], value); this.eventClassFQN = value; fieldSetFlags()[1] = true; return this; } /** * Checks whether the 'eventClassFQN' field has been set */ public boolean hasEventClassFQN() { return fieldSetFlags()[1]; } /** * Clears the value of the 'eventClassFQN' field */ public org.kaaproject.kaa.common.endpoint.gen.Event.Builder clearEventClassFQN() { eventClassFQN = null; fieldSetFlags()[1] = false; return this; } /** * Gets the value of the 'eventData' field */ public java.nio.ByteBuffer getEventData() { return eventData; } /** * Sets the value of the 'eventData' field */ public org.kaaproject.kaa.common.endpoint.gen.Event.Builder setEventData(java.nio.ByteBuffer value) { validate(fields()[2], value); this.eventData = value; fieldSetFlags()[2] = true; return this; } /** * Checks whether the 'eventData' field has been set */ public boolean hasEventData() { return fieldSetFlags()[2]; } /** * Clears the value of the 'eventData' field */ public org.kaaproject.kaa.common.endpoint.gen.Event.Builder clearEventData() { eventData = null; fieldSetFlags()[2] = false; return this; } /** * Gets the value of the 'source' field */ public java.lang.String getSource() { return source; } /** * Sets the value of the 'source' field */ public org.kaaproject.kaa.common.endpoint.gen.Event.Builder setSource(java.lang.String value) { validate(fields()[3], value); this.source = value; fieldSetFlags()[3] = true; return this; } /** * Checks whether the 'source' field has been set */ public boolean hasSource() { return fieldSetFlags()[3]; } /** * Clears the value of the 'source' field */ public org.kaaproject.kaa.common.endpoint.gen.Event.Builder clearSource() { source = null; fieldSetFlags()[3] = false; return this; } /** * Gets the value of the 'target' field */ public java.lang.String getTarget() { return target; } /** * Sets the value of the 'target' field */ public org.kaaproject.kaa.common.endpoint.gen.Event.Builder setTarget(java.lang.String value) { validate(fields()[4], value); this.target = value; fieldSetFlags()[4] = true; return this; } /** * Checks whether the 'target' field has been set */ public boolean hasTarget() { return fieldSetFlags()[4]; } /** * Clears the value of the 'target' field */ public org.kaaproject.kaa.common.endpoint.gen.Event.Builder clearTarget() { target = null; fieldSetFlags()[4] = false; return this; } @Override public Event build() { try { Event record = new Event(); record.seqNum = fieldSetFlags()[0] ? this.seqNum : (java.lang.Integer) defaultValue(fields()[0]); record.eventClassFQN = fieldSetFlags()[1] ? this.eventClassFQN : (java.lang.String) defaultValue(fields()[1]); record.eventData = fieldSetFlags()[2] ? this.eventData : (java.nio.ByteBuffer) defaultValue(fields()[2]); record.source = fieldSetFlags()[3] ? this.source : (java.lang.String) defaultValue(fields()[3]); record.target = fieldSetFlags()[4] ? this.target : (java.lang.String) defaultValue(fields()[4]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }