me.tfeng.play.security.oauth2.AuthenticationError Maven / Gradle / Ivy
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package me.tfeng.play.security.oauth2;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class AuthenticationError 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\":\"AuthenticationError\",\"namespace\":\"me.tfeng.play.security.oauth2\",\"fields\":[{\"name\":\"message\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
@Deprecated public java.lang.String message$;
public AuthenticationError() {
super();
}
public AuthenticationError(Object value) {
super(value);
}
public AuthenticationError(Throwable cause) {
super(cause);
}
public AuthenticationError(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 message$;
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: message$ = (java.lang.String)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'message$' field.
*/
public java.lang.String getMessage$() {
return message$;
}
/**
* Sets the value of the 'message$' field.
* @param value the value to set.
*/
public void setMessage$(java.lang.String value) {
this.message$ = value;
}
/** Creates a new AuthenticationError RecordBuilder */
public static me.tfeng.play.security.oauth2.AuthenticationError.Builder newBuilder() {
return new me.tfeng.play.security.oauth2.AuthenticationError.Builder();
}
/** Creates a new AuthenticationError RecordBuilder by copying an existing Builder */
public static me.tfeng.play.security.oauth2.AuthenticationError.Builder newBuilder(me.tfeng.play.security.oauth2.AuthenticationError.Builder other) {
return new me.tfeng.play.security.oauth2.AuthenticationError.Builder(other);
}
/** Creates a new AuthenticationError RecordBuilder by copying an existing AuthenticationError instance */
public static me.tfeng.play.security.oauth2.AuthenticationError.Builder newBuilder(me.tfeng.play.security.oauth2.AuthenticationError other) {
return new me.tfeng.play.security.oauth2.AuthenticationError.Builder(other);
}
/**
* RecordBuilder for AuthenticationError instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificErrorBuilderBase
implements org.apache.avro.data.ErrorBuilder {
private java.lang.String message$;
/** Creates a new Builder */
private Builder() {
super(me.tfeng.play.security.oauth2.AuthenticationError.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(me.tfeng.play.security.oauth2.AuthenticationError.Builder other) {
super(other);
if (isValidValue(fields()[0], other.message$)) {
this.message$ = data().deepCopy(fields()[0].schema(), other.message$);
fieldSetFlags()[0] = true;
}
}
/** Creates a Builder by copying an existing AuthenticationError instance */
private Builder(me.tfeng.play.security.oauth2.AuthenticationError other) {
super(other);
if (isValidValue(fields()[0], other.message$)) {
this.message$ = data().deepCopy(fields()[0].schema(), other.message$);
fieldSetFlags()[0] = true;
}
}
@Override
public me.tfeng.play.security.oauth2.AuthenticationError.Builder setValue(Object value) {
super.setValue(value);
return this;
}
@Override
public me.tfeng.play.security.oauth2.AuthenticationError.Builder clearValue() {
super.clearValue();
return this;
}
@Override
public me.tfeng.play.security.oauth2.AuthenticationError.Builder setCause(Throwable cause) {
super.setCause(cause);
return this;
}
@Override
public me.tfeng.play.security.oauth2.AuthenticationError.Builder clearCause() {
super.clearCause();
return this;
}
/** Gets the value of the 'message$' field */
public java.lang.String getMessage$() {
return message$;
}
/** Sets the value of the 'message$' field */
public me.tfeng.play.security.oauth2.AuthenticationError.Builder setMessage$(java.lang.String value) {
validate(fields()[0], value);
this.message$ = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'message$' field has been set */
public boolean hasMessage$() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'message$' field */
public me.tfeng.play.security.oauth2.AuthenticationError.Builder clearMessage$() {
message$ = null;
fieldSetFlags()[0] = false;
return this;
}
@Override
public AuthenticationError build() {
try {
AuthenticationError record = new AuthenticationError(getValue(), getCause());
record.message$ = fieldSetFlags()[0] ? this.message$ : (java.lang.String) defaultValue(fields()[0]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}