/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package org.kaaproject.kaa.common.endpoint.gen; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class EventSyncResponse 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\":\"EventSyncResponse\",\"namespace\":\"org.kaaproject.kaa.common.endpoint.gen\",\"fields\":[{\"name\":\"eventSequenceNumberResponse\",\"type\":[{\"type\":\"record\",\"name\":\"EventSequenceNumberResponse\",\"fields\":[{\"name\":\"seqNum\",\"type\":\"int\"}],\"direction\":\"in\"},\"null\"]},{\"name\":\"eventListenersResponses\",\"type\":[{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"EventListenersResponse\",\"fields\":[{\"name\":\"requestId\",\"type\":\"int\"},{\"name\":\"listeners\",\"type\":[{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},\"null\"]},{\"name\":\"result\",\"type\":{\"type\":\"enum\",\"name\":\"SyncResponseResultType\",\"symbols\":[\"SUCCESS\",\"FAILURE\",\"PROFILE_RESYNC\",\"REDIRECT\"]}}],\"direction\":\"in\"}},\"null\"]},{\"name\":\"events\",\"type\":[{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"Event\",\"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\"]}]}},\"null\"]}],\"direction\":\"in\"}"); private org.kaaproject.kaa.common.endpoint.gen.EventSequenceNumberResponse eventSequenceNumberResponse; private java.util.List<org.kaaproject.kaa.common.endpoint.gen.EventListenersResponse> eventListenersResponses; private java.util.List<org.kaaproject.kaa.common.endpoint.gen.Event> events; /** * 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 EventSyncResponse() { } /** * All-args constructor. */ public EventSyncResponse(org.kaaproject.kaa.common.endpoint.gen.EventSequenceNumberResponse eventSequenceNumberResponse, java.util.List<org.kaaproject.kaa.common.endpoint.gen.EventListenersResponse> eventListenersResponses, java.util.List<org.kaaproject.kaa.common.endpoint.gen.Event> events) { this.eventSequenceNumberResponse = eventSequenceNumberResponse; this.eventListenersResponses = eventListenersResponses; this.events = events; } public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } /** * Creates a new EventSyncResponse RecordBuilder */ public static org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.Builder newBuilder() { return new org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.Builder(); } /** * Creates a new EventSyncResponse RecordBuilder by copying an existing Builder */ public static org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.Builder other) { return new org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.Builder(other); } /** * Creates a new EventSyncResponse RecordBuilder by copying an existing EventSyncResponse instance */ public static org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse other) { return new org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.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 eventSequenceNumberResponse; case 1: return eventListenersResponses; case 2: return events; 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: eventSequenceNumberResponse = (org.kaaproject.kaa.common.endpoint.gen.EventSequenceNumberResponse) value$; break; case 1: eventListenersResponses = (java.util.List<org.kaaproject.kaa.common.endpoint.gen.EventListenersResponse>) value$; break; case 2: events = (java.util.List<org.kaaproject.kaa.common.endpoint.gen.Event>) value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'eventSequenceNumberResponse' field. */ public org.kaaproject.kaa.common.endpoint.gen.EventSequenceNumberResponse getEventSequenceNumberResponse() { return eventSequenceNumberResponse; } /** * Sets the value of the 'eventSequenceNumberResponse' field. * * @param value the value to set. */ public void setEventSequenceNumberResponse(org.kaaproject.kaa.common.endpoint.gen.EventSequenceNumberResponse value) { this.eventSequenceNumberResponse = value; } /** * Gets the value of the 'eventListenersResponses' field. */ public java.util.List<org.kaaproject.kaa.common.endpoint.gen.EventListenersResponse> getEventListenersResponses() { return eventListenersResponses; } /** * Sets the value of the 'eventListenersResponses' field. * * @param value the value to set. */ public void setEventListenersResponses(java.util.List<org.kaaproject.kaa.common.endpoint.gen.EventListenersResponse> value) { this.eventListenersResponses = value; } /** * Gets the value of the 'events' field. */ public java.util.List<org.kaaproject.kaa.common.endpoint.gen.Event> getEvents() { return events; } /** * Sets the value of the 'events' field. * * @param value the value to set. */ public void setEvents(java.util.List<org.kaaproject.kaa.common.endpoint.gen.Event> value) { this.events = value; } /** * RecordBuilder for EventSyncResponse instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<EventSyncResponse> implements org.apache.avro.data.RecordBuilder<EventSyncResponse> { private org.kaaproject.kaa.common.endpoint.gen.EventSequenceNumberResponse eventSequenceNumberResponse; private java.util.List<org.kaaproject.kaa.common.endpoint.gen.EventListenersResponse> eventListenersResponses; private java.util.List<org.kaaproject.kaa.common.endpoint.gen.Event> events; /** * Creates a new Builder */ private Builder() { super(org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.SCHEMA$); } /** * Creates a Builder by copying an existing Builder */ private Builder(org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.Builder other) { super(other); if (isValidValue(fields()[0], other.eventSequenceNumberResponse)) { this.eventSequenceNumberResponse = data().deepCopy(fields()[0].schema(), other.eventSequenceNumberResponse); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.eventListenersResponses)) { this.eventListenersResponses = data().deepCopy(fields()[1].schema(), other.eventListenersResponses); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.events)) { this.events = data().deepCopy(fields()[2].schema(), other.events); fieldSetFlags()[2] = true; } } /** * Creates a Builder by copying an existing EventSyncResponse instance */ private Builder(org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse other) { super(org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.SCHEMA$); if (isValidValue(fields()[0], other.eventSequenceNumberResponse)) { this.eventSequenceNumberResponse = data().deepCopy(fields()[0].schema(), other.eventSequenceNumberResponse); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.eventListenersResponses)) { this.eventListenersResponses = data().deepCopy(fields()[1].schema(), other.eventListenersResponses); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.events)) { this.events = data().deepCopy(fields()[2].schema(), other.events); fieldSetFlags()[2] = true; } } /** * Gets the value of the 'eventSequenceNumberResponse' field */ public org.kaaproject.kaa.common.endpoint.gen.EventSequenceNumberResponse getEventSequenceNumberResponse() { return eventSequenceNumberResponse; } /** * Sets the value of the 'eventSequenceNumberResponse' field */ public org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.Builder setEventSequenceNumberResponse(org.kaaproject.kaa.common.endpoint.gen.EventSequenceNumberResponse value) { validate(fields()[0], value); this.eventSequenceNumberResponse = value; fieldSetFlags()[0] = true; return this; } /** * Checks whether the 'eventSequenceNumberResponse' field has been set */ public boolean hasEventSequenceNumberResponse() { return fieldSetFlags()[0]; } /** * Clears the value of the 'eventSequenceNumberResponse' field */ public org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.Builder clearEventSequenceNumberResponse() { eventSequenceNumberResponse = null; fieldSetFlags()[0] = false; return this; } /** * Gets the value of the 'eventListenersResponses' field */ public java.util.List<org.kaaproject.kaa.common.endpoint.gen.EventListenersResponse> getEventListenersResponses() { return eventListenersResponses; } /** * Sets the value of the 'eventListenersResponses' field */ public org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.Builder setEventListenersResponses(java.util.List<org.kaaproject.kaa.common.endpoint.gen.EventListenersResponse> value) { validate(fields()[1], value); this.eventListenersResponses = value; fieldSetFlags()[1] = true; return this; } /** * Checks whether the 'eventListenersResponses' field has been set */ public boolean hasEventListenersResponses() { return fieldSetFlags()[1]; } /** * Clears the value of the 'eventListenersResponses' field */ public org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.Builder clearEventListenersResponses() { eventListenersResponses = null; fieldSetFlags()[1] = false; return this; } /** * Gets the value of the 'events' field */ public java.util.List<org.kaaproject.kaa.common.endpoint.gen.Event> getEvents() { return events; } /** * Sets the value of the 'events' field */ public org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.Builder setEvents(java.util.List<org.kaaproject.kaa.common.endpoint.gen.Event> value) { validate(fields()[2], value); this.events = value; fieldSetFlags()[2] = true; return this; } /** * Checks whether the 'events' field has been set */ public boolean hasEvents() { return fieldSetFlags()[2]; } /** * Clears the value of the 'events' field */ public org.kaaproject.kaa.common.endpoint.gen.EventSyncResponse.Builder clearEvents() { events = null; fieldSetFlags()[2] = false; return this; } @Override public EventSyncResponse build() { try { EventSyncResponse record = new EventSyncResponse(); record.eventSequenceNumberResponse = fieldSetFlags()[0] ? this.eventSequenceNumberResponse : (org.kaaproject.kaa.common.endpoint.gen.EventSequenceNumberResponse) defaultValue(fields()[0]); record.eventListenersResponses = fieldSetFlags()[1] ? this.eventListenersResponses : (java.util.List<org.kaaproject.kaa.common.endpoint.gen.EventListenersResponse>) defaultValue(fields()[1]); record.events = fieldSetFlags()[2] ? this.events : (java.util.List<org.kaaproject.kaa.common.endpoint.gen.Event>) defaultValue(fields()[2]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }