/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.kaaproject.kaa.common.endpoint.gen;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class LogDeliveryStatus 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\":\"LogDeliveryStatus\",\"namespace\":\"org.kaaproject.kaa.common.endpoint.gen\",\"fields\":[{\"name\":\"requestId\",\"type\":\"int\"},{\"name\":\"result\",\"type\":{\"type\":\"enum\",\"name\":\"SyncResponseResultType\",\"symbols\":[\"SUCCESS\",\"FAILURE\",\"PROFILE_RESYNC\",\"REDIRECT\"]}},{\"name\":\"errorCode\",\"type\":[{\"type\":\"enum\",\"name\":\"LogDeliveryErrorCode\",\"symbols\":[\"NO_APPENDERS_CONFIGURED\",\"APPENDER_INTERNAL_ERROR\",\"REMOTE_CONNECTION_ERROR\",\"REMOTE_INTERNAL_ERROR\"],\"direction\":\"in\"},\"null\"]}],\"direction\":\"in\"}");
private int requestId;
private org.kaaproject.kaa.common.endpoint.gen.SyncResponseResultType result;
private org.kaaproject.kaa.common.endpoint.gen.LogDeliveryErrorCode errorCode;
/**
* 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 LogDeliveryStatus() {
}
/**
* All-args constructor.
*/
public LogDeliveryStatus(java.lang.Integer requestId, org.kaaproject.kaa.common.endpoint.gen.SyncResponseResultType result, org.kaaproject.kaa.common.endpoint.gen.LogDeliveryErrorCode errorCode) {
this.requestId = requestId;
this.result = result;
this.errorCode = errorCode;
}
public static org.apache.avro.Schema getClassSchema() {
return SCHEMA$;
}
/**
* Creates a new LogDeliveryStatus RecordBuilder
*/
public static org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.Builder newBuilder() {
return new org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.Builder();
}
/**
* Creates a new LogDeliveryStatus RecordBuilder by copying an existing Builder
*/
public static org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.Builder other) {
return new org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.Builder(other);
}
/**
* Creates a new LogDeliveryStatus RecordBuilder by copying an existing LogDeliveryStatus instance
*/
public static org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus other) {
return new org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.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 requestId;
case 1:
return result;
case 2:
return errorCode;
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:
requestId = (java.lang.Integer) value$;
break;
case 1:
result = (org.kaaproject.kaa.common.endpoint.gen.SyncResponseResultType) value$;
break;
case 2:
errorCode = (org.kaaproject.kaa.common.endpoint.gen.LogDeliveryErrorCode) value$;
break;
default:
throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'requestId' field.
*/
public java.lang.Integer getRequestId() {
return requestId;
}
/**
* Sets the value of the 'requestId' field.
*
* @param value the value to set.
*/
public void setRequestId(java.lang.Integer value) {
this.requestId = value;
}
/**
* Gets the value of the 'result' field.
*/
public org.kaaproject.kaa.common.endpoint.gen.SyncResponseResultType getResult() {
return result;
}
/**
* Sets the value of the 'result' field.
*
* @param value the value to set.
*/
public void setResult(org.kaaproject.kaa.common.endpoint.gen.SyncResponseResultType value) {
this.result = value;
}
/**
* Gets the value of the 'errorCode' field.
*/
public org.kaaproject.kaa.common.endpoint.gen.LogDeliveryErrorCode getErrorCode() {
return errorCode;
}
/**
* Sets the value of the 'errorCode' field.
*
* @param value the value to set.
*/
public void setErrorCode(org.kaaproject.kaa.common.endpoint.gen.LogDeliveryErrorCode value) {
this.errorCode = value;
}
/**
* RecordBuilder for LogDeliveryStatus instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<LogDeliveryStatus>
implements org.apache.avro.data.RecordBuilder<LogDeliveryStatus> {
private int requestId;
private org.kaaproject.kaa.common.endpoint.gen.SyncResponseResultType result;
private org.kaaproject.kaa.common.endpoint.gen.LogDeliveryErrorCode errorCode;
/**
* Creates a new Builder
*/
private Builder() {
super(org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.SCHEMA$);
}
/**
* Creates a Builder by copying an existing Builder
*/
private Builder(org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.Builder other) {
super(other);
if (isValidValue(fields()[0], other.requestId)) {
this.requestId = data().deepCopy(fields()[0].schema(), other.requestId);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.result)) {
this.result = data().deepCopy(fields()[1].schema(), other.result);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.errorCode)) {
this.errorCode = data().deepCopy(fields()[2].schema(), other.errorCode);
fieldSetFlags()[2] = true;
}
}
/**
* Creates a Builder by copying an existing LogDeliveryStatus instance
*/
private Builder(org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus other) {
super(org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.SCHEMA$);
if (isValidValue(fields()[0], other.requestId)) {
this.requestId = data().deepCopy(fields()[0].schema(), other.requestId);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.result)) {
this.result = data().deepCopy(fields()[1].schema(), other.result);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.errorCode)) {
this.errorCode = data().deepCopy(fields()[2].schema(), other.errorCode);
fieldSetFlags()[2] = true;
}
}
/**
* Gets the value of the 'requestId' field
*/
public java.lang.Integer getRequestId() {
return requestId;
}
/**
* Sets the value of the 'requestId' field
*/
public org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.Builder setRequestId(int value) {
validate(fields()[0], value);
this.requestId = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'requestId' field has been set
*/
public boolean hasRequestId() {
return fieldSetFlags()[0];
}
/**
* Clears the value of the 'requestId' field
*/
public org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.Builder clearRequestId() {
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'result' field
*/
public org.kaaproject.kaa.common.endpoint.gen.SyncResponseResultType getResult() {
return result;
}
/**
* Sets the value of the 'result' field
*/
public org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.Builder setResult(org.kaaproject.kaa.common.endpoint.gen.SyncResponseResultType value) {
validate(fields()[1], value);
this.result = value;
fieldSetFlags()[1] = true;
return this;
}
/**
* Checks whether the 'result' field has been set
*/
public boolean hasResult() {
return fieldSetFlags()[1];
}
/**
* Clears the value of the 'result' field
*/
public org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.Builder clearResult() {
result = null;
fieldSetFlags()[1] = false;
return this;
}
/**
* Gets the value of the 'errorCode' field
*/
public org.kaaproject.kaa.common.endpoint.gen.LogDeliveryErrorCode getErrorCode() {
return errorCode;
}
/**
* Sets the value of the 'errorCode' field
*/
public org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.Builder setErrorCode(org.kaaproject.kaa.common.endpoint.gen.LogDeliveryErrorCode value) {
validate(fields()[2], value);
this.errorCode = value;
fieldSetFlags()[2] = true;
return this;
}
/**
* Checks whether the 'errorCode' field has been set
*/
public boolean hasErrorCode() {
return fieldSetFlags()[2];
}
/**
* Clears the value of the 'errorCode' field
*/
public org.kaaproject.kaa.common.endpoint.gen.LogDeliveryStatus.Builder clearErrorCode() {
errorCode = null;
fieldSetFlags()[2] = false;
return this;
}
@Override
public LogDeliveryStatus build() {
try {
LogDeliveryStatus record = new LogDeliveryStatus();
record.requestId = fieldSetFlags()[0] ? this.requestId : (java.lang.Integer) defaultValue(fields()[0]);
record.result = fieldSetFlags()[1] ? this.result : (org.kaaproject.kaa.common.endpoint.gen.SyncResponseResultType) defaultValue(fields()[1]);
record.errorCode = fieldSetFlags()[2] ? this.errorCode : (org.kaaproject.kaa.common.endpoint.gen.LogDeliveryErrorCode) defaultValue(fields()[2]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}