org.apache.reef.io.watcher.common.AvroFailure Maven / Gradle / Ivy
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.apache.reef.io.watcher.common;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class AvroFailure 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\":\"AvroFailure\",\"namespace\":\"org.apache.reef.io.watcher.common\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"description\",\"type\":[\"string\",\"null\"]},{\"name\":\"reason\",\"type\":[\"string\",\"null\"]},{\"name\":\"data\",\"type\":[\"bytes\",\"null\"]},{\"name\":\"asError\",\"type\":\"string\"}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
@Deprecated public java.lang.CharSequence id;
@Deprecated public java.lang.CharSequence message;
@Deprecated public java.lang.CharSequence description;
@Deprecated public java.lang.CharSequence reason;
@Deprecated public java.nio.ByteBuffer data;
@Deprecated public java.lang.CharSequence asError;
/**
* Default constructor. Note that this does not initialize fields
* to their default values from the schema. If that is desired then
* one should use newBuilder()
.
*/
public AvroFailure() {}
/**
* All-args constructor.
*/
public AvroFailure(java.lang.CharSequence id, java.lang.CharSequence message, java.lang.CharSequence description, java.lang.CharSequence reason, java.nio.ByteBuffer data, java.lang.CharSequence asError) {
this.id = id;
this.message = message;
this.description = description;
this.reason = reason;
this.data = data;
this.asError = asError;
}
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 id;
case 1: return message;
case 2: return description;
case 3: return reason;
case 4: return data;
case 5: return asError;
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: id = (java.lang.CharSequence)value$; break;
case 1: message = (java.lang.CharSequence)value$; break;
case 2: description = (java.lang.CharSequence)value$; break;
case 3: reason = (java.lang.CharSequence)value$; break;
case 4: data = (java.nio.ByteBuffer)value$; break;
case 5: asError = (java.lang.CharSequence)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'id' field.
*/
public java.lang.CharSequence getId() {
return id;
}
/**
* Sets the value of the 'id' field.
* @param value the value to set.
*/
public void setId(java.lang.CharSequence value) {
this.id = value;
}
/**
* Gets the value of the 'message' field.
*/
public java.lang.CharSequence getMessage() {
return message;
}
/**
* Sets the value of the 'message' field.
* @param value the value to set.
*/
public void setMessage(java.lang.CharSequence value) {
this.message = value;
}
/**
* Gets the value of the 'description' field.
*/
public java.lang.CharSequence getDescription() {
return description;
}
/**
* Sets the value of the 'description' field.
* @param value the value to set.
*/
public void setDescription(java.lang.CharSequence value) {
this.description = value;
}
/**
* Gets the value of the 'reason' field.
*/
public java.lang.CharSequence getReason() {
return reason;
}
/**
* Sets the value of the 'reason' field.
* @param value the value to set.
*/
public void setReason(java.lang.CharSequence value) {
this.reason = value;
}
/**
* Gets the value of the 'data' field.
*/
public java.nio.ByteBuffer getData() {
return data;
}
/**
* Sets the value of the 'data' field.
* @param value the value to set.
*/
public void setData(java.nio.ByteBuffer value) {
this.data = value;
}
/**
* Gets the value of the 'asError' field.
*/
public java.lang.CharSequence getAsError() {
return asError;
}
/**
* Sets the value of the 'asError' field.
* @param value the value to set.
*/
public void setAsError(java.lang.CharSequence value) {
this.asError = value;
}
/** Creates a new AvroFailure RecordBuilder */
public static org.apache.reef.io.watcher.common.AvroFailure.Builder newBuilder() {
return new org.apache.reef.io.watcher.common.AvroFailure.Builder();
}
/** Creates a new AvroFailure RecordBuilder by copying an existing Builder */
public static org.apache.reef.io.watcher.common.AvroFailure.Builder newBuilder(org.apache.reef.io.watcher.common.AvroFailure.Builder other) {
return new org.apache.reef.io.watcher.common.AvroFailure.Builder(other);
}
/** Creates a new AvroFailure RecordBuilder by copying an existing AvroFailure instance */
public static org.apache.reef.io.watcher.common.AvroFailure.Builder newBuilder(org.apache.reef.io.watcher.common.AvroFailure other) {
return new org.apache.reef.io.watcher.common.AvroFailure.Builder(other);
}
/**
* RecordBuilder for AvroFailure instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private java.lang.CharSequence id;
private java.lang.CharSequence message;
private java.lang.CharSequence description;
private java.lang.CharSequence reason;
private java.nio.ByteBuffer data;
private java.lang.CharSequence asError;
/** Creates a new Builder */
private Builder() {
super(org.apache.reef.io.watcher.common.AvroFailure.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.apache.reef.io.watcher.common.AvroFailure.Builder other) {
super(other);
if (isValidValue(fields()[0], other.id)) {
this.id = data().deepCopy(fields()[0].schema(), other.id);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.message)) {
this.message = data().deepCopy(fields()[1].schema(), other.message);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.description)) {
this.description = data().deepCopy(fields()[2].schema(), other.description);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.reason)) {
this.reason = data().deepCopy(fields()[3].schema(), other.reason);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.data)) {
this.data = data().deepCopy(fields()[4].schema(), other.data);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.asError)) {
this.asError = data().deepCopy(fields()[5].schema(), other.asError);
fieldSetFlags()[5] = true;
}
}
/** Creates a Builder by copying an existing AvroFailure instance */
private Builder(org.apache.reef.io.watcher.common.AvroFailure other) {
super(org.apache.reef.io.watcher.common.AvroFailure.SCHEMA$);
if (isValidValue(fields()[0], other.id)) {
this.id = data().deepCopy(fields()[0].schema(), other.id);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.message)) {
this.message = data().deepCopy(fields()[1].schema(), other.message);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.description)) {
this.description = data().deepCopy(fields()[2].schema(), other.description);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.reason)) {
this.reason = data().deepCopy(fields()[3].schema(), other.reason);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.data)) {
this.data = data().deepCopy(fields()[4].schema(), other.data);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.asError)) {
this.asError = data().deepCopy(fields()[5].schema(), other.asError);
fieldSetFlags()[5] = true;
}
}
/** Gets the value of the 'id' field */
public java.lang.CharSequence getId() {
return id;
}
/** Sets the value of the 'id' field */
public org.apache.reef.io.watcher.common.AvroFailure.Builder setId(java.lang.CharSequence value) {
validate(fields()[0], value);
this.id = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'id' field has been set */
public boolean hasId() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'id' field */
public org.apache.reef.io.watcher.common.AvroFailure.Builder clearId() {
id = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'message' field */
public java.lang.CharSequence getMessage() {
return message;
}
/** Sets the value of the 'message' field */
public org.apache.reef.io.watcher.common.AvroFailure.Builder setMessage(java.lang.CharSequence value) {
validate(fields()[1], value);
this.message = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'message' field has been set */
public boolean hasMessage() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'message' field */
public org.apache.reef.io.watcher.common.AvroFailure.Builder clearMessage() {
message = null;
fieldSetFlags()[1] = false;
return this;
}
/** Gets the value of the 'description' field */
public java.lang.CharSequence getDescription() {
return description;
}
/** Sets the value of the 'description' field */
public org.apache.reef.io.watcher.common.AvroFailure.Builder setDescription(java.lang.CharSequence value) {
validate(fields()[2], value);
this.description = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'description' field has been set */
public boolean hasDescription() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'description' field */
public org.apache.reef.io.watcher.common.AvroFailure.Builder clearDescription() {
description = null;
fieldSetFlags()[2] = false;
return this;
}
/** Gets the value of the 'reason' field */
public java.lang.CharSequence getReason() {
return reason;
}
/** Sets the value of the 'reason' field */
public org.apache.reef.io.watcher.common.AvroFailure.Builder setReason(java.lang.CharSequence value) {
validate(fields()[3], value);
this.reason = value;
fieldSetFlags()[3] = true;
return this;
}
/** Checks whether the 'reason' field has been set */
public boolean hasReason() {
return fieldSetFlags()[3];
}
/** Clears the value of the 'reason' field */
public org.apache.reef.io.watcher.common.AvroFailure.Builder clearReason() {
reason = null;
fieldSetFlags()[3] = false;
return this;
}
/** Gets the value of the 'data' field */
public java.nio.ByteBuffer getData() {
return data;
}
/** Sets the value of the 'data' field */
public org.apache.reef.io.watcher.common.AvroFailure.Builder setData(java.nio.ByteBuffer value) {
validate(fields()[4], value);
this.data = value;
fieldSetFlags()[4] = true;
return this;
}
/** Checks whether the 'data' field has been set */
public boolean hasData() {
return fieldSetFlags()[4];
}
/** Clears the value of the 'data' field */
public org.apache.reef.io.watcher.common.AvroFailure.Builder clearData() {
data = null;
fieldSetFlags()[4] = false;
return this;
}
/** Gets the value of the 'asError' field */
public java.lang.CharSequence getAsError() {
return asError;
}
/** Sets the value of the 'asError' field */
public org.apache.reef.io.watcher.common.AvroFailure.Builder setAsError(java.lang.CharSequence value) {
validate(fields()[5], value);
this.asError = value;
fieldSetFlags()[5] = true;
return this;
}
/** Checks whether the 'asError' field has been set */
public boolean hasAsError() {
return fieldSetFlags()[5];
}
/** Clears the value of the 'asError' field */
public org.apache.reef.io.watcher.common.AvroFailure.Builder clearAsError() {
asError = null;
fieldSetFlags()[5] = false;
return this;
}
@Override
public AvroFailure build() {
try {
AvroFailure record = new AvroFailure();
record.id = fieldSetFlags()[0] ? this.id : (java.lang.CharSequence) defaultValue(fields()[0]);
record.message = fieldSetFlags()[1] ? this.message : (java.lang.CharSequence) defaultValue(fields()[1]);
record.description = fieldSetFlags()[2] ? this.description : (java.lang.CharSequence) defaultValue(fields()[2]);
record.reason = fieldSetFlags()[3] ? this.reason : (java.lang.CharSequence) defaultValue(fields()[3]);
record.data = fieldSetFlags()[4] ? this.data : (java.nio.ByteBuffer) defaultValue(fields()[4]);
record.asError = fieldSetFlags()[5] ? this.asError : (java.lang.CharSequence) defaultValue(fields()[5]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy