/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package com.cloudera.knittingboar.yarn.avro.generated;
@SuppressWarnings("all")
public class ServiceError extends org.apache.avro.specific.SpecificExceptionBase implements org.apache.avro.specific.SpecificRecord {
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"error\",\"name\":\"ServiceError\",\"namespace\":\"com.cloudera.knittingboar.yarn.avro.generated\",\"fields\":[{\"name\":\"description\",\"type\":[\"null\",\"string\"]}]}");
@Deprecated public java.lang.CharSequence description;
public ServiceError() {
super();
}
public ServiceError(Object value) {
super(value);
}
public ServiceError(Throwable cause) {
super(cause);
}
public ServiceError(Object value, Throwable cause) {
super(value, cause);
}
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 description;
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: description = (java.lang.CharSequence)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* 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;
}
/** Creates a new ServiceError RecordBuilder */
public static com.cloudera.knittingboar.yarn.avro.generated.ServiceError.Builder newBuilder() {
return new com.cloudera.knittingboar.yarn.avro.generated.ServiceError.Builder();
}
/** Creates a new ServiceError RecordBuilder by copying an existing Builder */
public static com.cloudera.knittingboar.yarn.avro.generated.ServiceError.Builder newBuilder(com.cloudera.knittingboar.yarn.avro.generated.ServiceError.Builder other) {
return new com.cloudera.knittingboar.yarn.avro.generated.ServiceError.Builder(other);
}
/** Creates a new ServiceError RecordBuilder by copying an existing ServiceError instance */
public static com.cloudera.knittingboar.yarn.avro.generated.ServiceError.Builder newBuilder(com.cloudera.knittingboar.yarn.avro.generated.ServiceError other) {
return new com.cloudera.knittingboar.yarn.avro.generated.ServiceError.Builder(other);
}
/**
* RecordBuilder for ServiceError instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificErrorBuilderBase<ServiceError>
implements org.apache.avro.data.ErrorBuilder<ServiceError> {
private java.lang.CharSequence description;
/** Creates a new Builder */
private Builder() {
super(com.cloudera.knittingboar.yarn.avro.generated.ServiceError.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(com.cloudera.knittingboar.yarn.avro.generated.ServiceError.Builder other) {
super(other);
}
/** Creates a Builder by copying an existing ServiceError instance */
private Builder(com.cloudera.knittingboar.yarn.avro.generated.ServiceError other) {
super(other);
if (isValidValue(fields()[0], other.description)) {
this.description = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.description);
fieldSetFlags()[0] = true;
}
}
@Override
public com.cloudera.knittingboar.yarn.avro.generated.ServiceError.Builder setValue(Object value) {
super.setValue(value);
return this;
}
@Override
public com.cloudera.knittingboar.yarn.avro.generated.ServiceError.Builder clearValue() {
super.clearValue();
return this;
}
@Override
public com.cloudera.knittingboar.yarn.avro.generated.ServiceError.Builder setCause(Throwable cause) {
super.setCause(cause);
return this;
}
@Override
public com.cloudera.knittingboar.yarn.avro.generated.ServiceError.Builder clearCause() {
super.clearCause();
return this;
}
/** Gets the value of the 'description' field */
public java.lang.CharSequence getDescription() {
return description;
}
/** Sets the value of the 'description' field */
public com.cloudera.knittingboar.yarn.avro.generated.ServiceError.Builder setDescription(java.lang.CharSequence value) {
validate(fields()[0], value);
this.description = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'description' field has been set */
public boolean hasDescription() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'description' field */
public com.cloudera.knittingboar.yarn.avro.generated.ServiceError.Builder clearDescription() {
description = null;
fieldSetFlags()[0] = false;
return this;
}
@Override
public ServiceError build() {
try {
ServiceError record = new ServiceError(getValue(), getCause());
record.description = fieldSetFlags()[0] ? this.description : (java.lang.CharSequence) defaultValue(fields()[0]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}