/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.kaaproject.kaa.common.endpoint.gen;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class ConfigurationSyncRequest 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\":\"ConfigurationSyncRequest\",\"namespace\":\"org.kaaproject.kaa.common.endpoint.gen\",\"fields\":[{\"name\":\"configurationHash\",\"type\":\"bytes\"},{\"name\":\"resyncOnly\",\"type\":[\"boolean\",\"null\"]}],\"direction\":\"out\"}");
private java.nio.ByteBuffer configurationHash;
private java.lang.Boolean resyncOnly;
/**
* 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 ConfigurationSyncRequest() {
}
/**
* All-args constructor.
*/
public ConfigurationSyncRequest(java.nio.ByteBuffer configurationHash, java.lang.Boolean resyncOnly) {
this.configurationHash = configurationHash;
this.resyncOnly = resyncOnly;
}
public static org.apache.avro.Schema getClassSchema() {
return SCHEMA$;
}
/**
* Creates a new ConfigurationSyncRequest RecordBuilder
*/
public static org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest.Builder newBuilder() {
return new org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest.Builder();
}
/**
* Creates a new ConfigurationSyncRequest RecordBuilder by copying an existing Builder
*/
public static org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest.Builder other) {
return new org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest.Builder(other);
}
/**
* Creates a new ConfigurationSyncRequest RecordBuilder by copying an existing
* ConfigurationSyncRequest instance
*/
public static org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest other) {
return new org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest.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 configurationHash;
case 1:
return resyncOnly;
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:
configurationHash = (java.nio.ByteBuffer) value$;
break;
case 1:
resyncOnly = (java.lang.Boolean) value$;
break;
default:
throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'configurationHash' field.
*/
public java.nio.ByteBuffer getConfigurationHash() {
return configurationHash;
}
/**
* Sets the value of the 'configurationHash' field.
*
* @param value the value to set.
*/
public void setConfigurationHash(java.nio.ByteBuffer value) {
this.configurationHash = value;
}
/**
* Gets the value of the 'resyncOnly' field.
*/
public java.lang.Boolean getResyncOnly() {
return resyncOnly;
}
/**
* Sets the value of the 'resyncOnly' field.
*
* @param value the value to set.
*/
public void setResyncOnly(java.lang.Boolean value) {
this.resyncOnly = value;
}
/**
* RecordBuilder for ConfigurationSyncRequest instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<ConfigurationSyncRequest>
implements org.apache.avro.data.RecordBuilder<ConfigurationSyncRequest> {
private java.nio.ByteBuffer configurationHash;
private java.lang.Boolean resyncOnly;
/**
* Creates a new Builder
*/
private Builder() {
super(org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest.SCHEMA$);
}
/**
* Creates a Builder by copying an existing Builder
*/
private Builder(org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest.Builder other) {
super(other);
if (isValidValue(fields()[0], other.configurationHash)) {
this.configurationHash = data().deepCopy(fields()[0].schema(), other.configurationHash);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.resyncOnly)) {
this.resyncOnly = data().deepCopy(fields()[1].schema(), other.resyncOnly);
fieldSetFlags()[1] = true;
}
}
/**
* Creates a Builder by copying an existing ConfigurationSyncRequest instance
*/
private Builder(org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest other) {
super(org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest.SCHEMA$);
if (isValidValue(fields()[0], other.configurationHash)) {
this.configurationHash = data().deepCopy(fields()[0].schema(), other.configurationHash);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.resyncOnly)) {
this.resyncOnly = data().deepCopy(fields()[1].schema(), other.resyncOnly);
fieldSetFlags()[1] = true;
}
}
/**
* Gets the value of the 'configurationHash' field
*/
public java.nio.ByteBuffer getConfigurationHash() {
return configurationHash;
}
/**
* Sets the value of the 'configurationHash' field
*/
public org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest.Builder setConfigurationHash(java.nio.ByteBuffer value) {
validate(fields()[0], value);
this.configurationHash = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'configurationHash' field has been set
*/
public boolean hasConfigurationHash() {
return fieldSetFlags()[0];
}
/**
* Clears the value of the 'configurationHash' field
*/
public org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest.Builder clearConfigurationHash() {
configurationHash = null;
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'resyncOnly' field
*/
public java.lang.Boolean getResyncOnly() {
return resyncOnly;
}
/**
* Sets the value of the 'resyncOnly' field
*/
public org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest.Builder setResyncOnly(java.lang.Boolean value) {
validate(fields()[1], value);
this.resyncOnly = value;
fieldSetFlags()[1] = true;
return this;
}
/**
* Checks whether the 'resyncOnly' field has been set
*/
public boolean hasResyncOnly() {
return fieldSetFlags()[1];
}
/**
* Clears the value of the 'resyncOnly' field
*/
public org.kaaproject.kaa.common.endpoint.gen.ConfigurationSyncRequest.Builder clearResyncOnly() {
resyncOnly = null;
fieldSetFlags()[1] = false;
return this;
}
@Override
public ConfigurationSyncRequest build() {
try {
ConfigurationSyncRequest record = new ConfigurationSyncRequest();
record.configurationHash = fieldSetFlags()[0] ? this.configurationHash : (java.nio.ByteBuffer) defaultValue(fields()[0]);
record.resyncOnly = fieldSetFlags()[1] ? this.resyncOnly : (java.lang.Boolean) defaultValue(fields()[1]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}