/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package org.kaaproject.kaa.common.endpoint.gen; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class ConfigurationSyncResponse 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\":\"ConfigurationSyncResponse\",\"namespace\":\"org.kaaproject.kaa.common.endpoint.gen\",\"fields\":[{\"name\":\"responseStatus\",\"type\":{\"type\":\"enum\",\"name\":\"SyncResponseStatus\",\"symbols\":[\"NO_DELTA\",\"DELTA\",\"RESYNC\"]}},{\"name\":\"confSchemaBody\",\"type\":[\"bytes\",\"null\"]},{\"name\":\"confDeltaBody\",\"type\":[\"bytes\",\"null\"]}],\"direction\":\"in\"}"); private org.kaaproject.kaa.common.endpoint.gen.SyncResponseStatus responseStatus; private java.nio.ByteBuffer confSchemaBody; private java.nio.ByteBuffer confDeltaBody; /** * 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 ConfigurationSyncResponse() { } /** * All-args constructor. */ public ConfigurationSyncResponse(org.kaaproject.kaa.common.endpoint.gen.SyncResponseStatus responseStatus, java.nio.ByteBuffer confSchemaBody, java.nio.ByteBuffer confDeltaBody) { this.responseStatus = responseStatus; this.confSchemaBody = confSchemaBody; this.confDeltaBody = confDeltaBody; } public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } /** * Creates a new ConfigurationSyncResponse RecordBuilder */ public static org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.Builder newBuilder() { return new org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.Builder(); } /** * Creates a new ConfigurationSyncResponse RecordBuilder by copying an existing Builder */ public static org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.Builder other) { return new org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.Builder(other); } /** * Creates a new ConfigurationSyncResponse RecordBuilder by copying an existing * ConfigurationSyncResponse instance */ public static org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse other) { return new org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.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 responseStatus; case 1: return confSchemaBody; case 2: return confDeltaBody; 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: responseStatus = (org.kaaproject.kaa.common.endpoint.gen.SyncResponseStatus) value$; break; case 1: confSchemaBody = (java.nio.ByteBuffer) value$; break; case 2: confDeltaBody = (java.nio.ByteBuffer) value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'responseStatus' field. */ public org.kaaproject.kaa.common.endpoint.gen.SyncResponseStatus getResponseStatus() { return responseStatus; } /** * Sets the value of the 'responseStatus' field. * * @param value the value to set. */ public void setResponseStatus(org.kaaproject.kaa.common.endpoint.gen.SyncResponseStatus value) { this.responseStatus = value; } /** * Gets the value of the 'confSchemaBody' field. */ public java.nio.ByteBuffer getConfSchemaBody() { return confSchemaBody; } /** * Sets the value of the 'confSchemaBody' field. * * @param value the value to set. */ public void setConfSchemaBody(java.nio.ByteBuffer value) { this.confSchemaBody = value; } /** * Gets the value of the 'confDeltaBody' field. */ public java.nio.ByteBuffer getConfDeltaBody() { return confDeltaBody; } /** * Sets the value of the 'confDeltaBody' field. * * @param value the value to set. */ public void setConfDeltaBody(java.nio.ByteBuffer value) { this.confDeltaBody = value; } /** * RecordBuilder for ConfigurationSyncResponse instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<ConfigurationSyncResponse> implements org.apache.avro.data.RecordBuilder<ConfigurationSyncResponse> { private org.kaaproject.kaa.common.endpoint.gen.SyncResponseStatus responseStatus; private java.nio.ByteBuffer confSchemaBody; private java.nio.ByteBuffer confDeltaBody; /** * Creates a new Builder */ private Builder() { super(org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.SCHEMA$); } /** * Creates a Builder by copying an existing Builder */ private Builder(org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.Builder other) { super(other); if (isValidValue(fields()[0], other.responseStatus)) { this.responseStatus = data().deepCopy(fields()[0].schema(), other.responseStatus); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.confSchemaBody)) { this.confSchemaBody = data().deepCopy(fields()[1].schema(), other.confSchemaBody); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.confDeltaBody)) { this.confDeltaBody = data().deepCopy(fields()[2].schema(), other.confDeltaBody); fieldSetFlags()[2] = true; } } /** * Creates a Builder by copying an existing ConfigurationSyncResponse instance */ private Builder(org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse other) { super(org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.SCHEMA$); if (isValidValue(fields()[0], other.responseStatus)) { this.responseStatus = data().deepCopy(fields()[0].schema(), other.responseStatus); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.confSchemaBody)) { this.confSchemaBody = data().deepCopy(fields()[1].schema(), other.confSchemaBody); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.confDeltaBody)) { this.confDeltaBody = data().deepCopy(fields()[2].schema(), other.confDeltaBody); fieldSetFlags()[2] = true; } } /** * Gets the value of the 'responseStatus' field */ public org.kaaproject.kaa.common.endpoint.gen.SyncResponseStatus getResponseStatus() { return responseStatus; } /** * Sets the value of the 'responseStatus' field */ public org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.Builder setResponseStatus(org.kaaproject.kaa.common.endpoint.gen.SyncResponseStatus value) { validate(fields()[0], value); this.responseStatus = value; fieldSetFlags()[0] = true; return this; } /** * Checks whether the 'responseStatus' field has been set */ public boolean hasResponseStatus() { return fieldSetFlags()[0]; } /** * Clears the value of the 'responseStatus' field */ public org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.Builder clearResponseStatus() { responseStatus = null; fieldSetFlags()[0] = false; return this; } /** * Gets the value of the 'confSchemaBody' field */ public java.nio.ByteBuffer getConfSchemaBody() { return confSchemaBody; } /** * Sets the value of the 'confSchemaBody' field */ public org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.Builder setConfSchemaBody(java.nio.ByteBuffer value) { validate(fields()[1], value); this.confSchemaBody = value; fieldSetFlags()[1] = true; return this; } /** * Checks whether the 'confSchemaBody' field has been set */ public boolean hasConfSchemaBody() { return fieldSetFlags()[1]; } /** * Clears the value of the 'confSchemaBody' field */ public org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.Builder clearConfSchemaBody() { confSchemaBody = null; fieldSetFlags()[1] = false; return this; } /** * Gets the value of the 'confDeltaBody' field */ public java.nio.ByteBuffer getConfDeltaBody() { return confDeltaBody; } /** * Sets the value of the 'confDeltaBody' field */ public org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.Builder setConfDeltaBody(java.nio.ByteBuffer value) { validate(fields()[2], value); this.confDeltaBody = value; fieldSetFlags()[2] = true; return this; } /** * Checks whether the 'confDeltaBody' field has been set */ public boolean hasConfDeltaBody() { return fieldSetFlags()[2]; } /** * Clears the value of the 'confDeltaBody' field */ public org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncResponse.Builder clearConfDeltaBody() { confDeltaBody = null; fieldSetFlags()[2] = false; return this; } @Override public ConfigurationSyncResponse build() { try { ConfigurationSyncResponse record = new ConfigurationSyncResponse(); record.responseStatus = fieldSetFlags()[0] ? this.responseStatus : (org.kaaproject.kaa.common.endpoint.gen.SyncResponseStatus) defaultValue(fields()[0]); record.confSchemaBody = fieldSetFlags()[1] ? this.confSchemaBody : (java.nio.ByteBuffer) defaultValue(fields()[1]); record.confDeltaBody = fieldSetFlags()[2] ? this.confDeltaBody : (java.nio.ByteBuffer) defaultValue(fields()[2]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }