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