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