/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.kaaproject.kaa.server.flume;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class TestLogData 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\":\"TestLogData\",\"namespace\":\"org.kaaproject.kaa.server.flume\",\"fields\":[{\"name\":\"level\",\"type\":{\"type\":\"enum\",\"name\":\"Level\",\"symbols\":[\"DEBUG\",\"ERROR\",\"FATAL\",\"INFO\",\"TRACE\",\"WARN\"]}},{\"name\":\"tag\",\"type\":\"string\"},{\"name\":\"message\",\"type\":\"string\"}]}");
@Deprecated
public org.kaaproject.kaa.server.flume.Level level;
@Deprecated
public java.lang.CharSequence tag;
@Deprecated
public java.lang.CharSequence message;
/**
* Default constructor. Note that this does not initialize fields
* to their default values from the schema. If that is desired then
* one should use <code>newBuilder()</code>.
*/
public TestLogData() {
}
/**
* All-args constructor.
*/
public TestLogData(org.kaaproject.kaa.server.flume.Level level, java.lang.CharSequence tag, java.lang.CharSequence message) {
this.level = level;
this.tag = tag;
this.message = message;
}
public static org.apache.avro.Schema getClassSchema() {
return SCHEMA$;
}
/**
* Creates a new TestLogData RecordBuilder
*/
public static org.kaaproject.kaa.server.flume.TestLogData.Builder newBuilder() {
return new org.kaaproject.kaa.server.flume.TestLogData.Builder();
}
/**
* Creates a new TestLogData RecordBuilder by copying an existing Builder
*/
public static org.kaaproject.kaa.server.flume.TestLogData.Builder newBuilder(org.kaaproject.kaa.server.flume.TestLogData.Builder other) {
return new org.kaaproject.kaa.server.flume.TestLogData.Builder(other);
}
/**
* Creates a new TestLogData RecordBuilder by copying an existing TestLogData instance
*/
public static org.kaaproject.kaa.server.flume.TestLogData.Builder newBuilder(org.kaaproject.kaa.server.flume.TestLogData other) {
return new org.kaaproject.kaa.server.flume.TestLogData.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 level;
case 1:
return tag;
case 2:
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:
level = (org.kaaproject.kaa.server.flume.Level) value$;
break;
case 1:
tag = (java.lang.CharSequence) value$;
break;
case 2:
message = (java.lang.CharSequence) value$;
break;
default:
throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'level' field.
*/
public org.kaaproject.kaa.server.flume.Level getLevel() {
return level;
}
/**
* Sets the value of the 'level' field.
*
* @param value the value to set.
*/
public void setLevel(org.kaaproject.kaa.server.flume.Level value) {
this.level = value;
}
/**
* Gets the value of the 'tag' field.
*/
public java.lang.CharSequence getTag() {
return tag;
}
/**
* Sets the value of the 'tag' field.
*
* @param value the value to set.
*/
public void setTag(java.lang.CharSequence value) {
this.tag = 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;
}
/**
* RecordBuilder for TestLogData instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<TestLogData>
implements org.apache.avro.data.RecordBuilder<TestLogData> {
private org.kaaproject.kaa.server.flume.Level level;
private java.lang.CharSequence tag;
private java.lang.CharSequence message;
/**
* Creates a new Builder
*/
private Builder() {
super(org.kaaproject.kaa.server.flume.TestLogData.SCHEMA$);
}
/**
* Creates a Builder by copying an existing Builder
*/
private Builder(org.kaaproject.kaa.server.flume.TestLogData.Builder other) {
super(other);
if (isValidValue(fields()[0], other.level)) {
this.level = data().deepCopy(fields()[0].schema(), other.level);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.tag)) {
this.tag = data().deepCopy(fields()[1].schema(), other.tag);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.message)) {
this.message = data().deepCopy(fields()[2].schema(), other.message);
fieldSetFlags()[2] = true;
}
}
/**
* Creates a Builder by copying an existing TestLogData instance
*/
private Builder(org.kaaproject.kaa.server.flume.TestLogData other) {
super(org.kaaproject.kaa.server.flume.TestLogData.SCHEMA$);
if (isValidValue(fields()[0], other.level)) {
this.level = data().deepCopy(fields()[0].schema(), other.level);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.tag)) {
this.tag = data().deepCopy(fields()[1].schema(), other.tag);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.message)) {
this.message = data().deepCopy(fields()[2].schema(), other.message);
fieldSetFlags()[2] = true;
}
}
/**
* Gets the value of the 'level' field
*/
public org.kaaproject.kaa.server.flume.Level getLevel() {
return level;
}
/**
* Sets the value of the 'level' field
*/
public org.kaaproject.kaa.server.flume.TestLogData.Builder setLevel(org.kaaproject.kaa.server.flume.Level value) {
validate(fields()[0], value);
this.level = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'level' field has been set
*/
public boolean hasLevel() {
return fieldSetFlags()[0];
}
/**
* Clears the value of the 'level' field
*/
public org.kaaproject.kaa.server.flume.TestLogData.Builder clearLevel() {
level = null;
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'tag' field
*/
public java.lang.CharSequence getTag() {
return tag;
}
/**
* Sets the value of the 'tag' field
*/
public org.kaaproject.kaa.server.flume.TestLogData.Builder setTag(java.lang.CharSequence value) {
validate(fields()[1], value);
this.tag = value;
fieldSetFlags()[1] = true;
return this;
}
/**
* Checks whether the 'tag' field has been set
*/
public boolean hasTag() {
return fieldSetFlags()[1];
}
/**
* Clears the value of the 'tag' field
*/
public org.kaaproject.kaa.server.flume.TestLogData.Builder clearTag() {
tag = null;
fieldSetFlags()[1] = 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.kaaproject.kaa.server.flume.TestLogData.Builder setMessage(java.lang.CharSequence value) {
validate(fields()[2], value);
this.message = value;
fieldSetFlags()[2] = true;
return this;
}
/**
* Checks whether the 'message' field has been set
*/
public boolean hasMessage() {
return fieldSetFlags()[2];
}
/**
* Clears the value of the 'message' field
*/
public org.kaaproject.kaa.server.flume.TestLogData.Builder clearMessage() {
message = null;
fieldSetFlags()[2] = false;
return this;
}
@Override
public TestLogData build() {
try {
TestLogData record = new TestLogData();
record.level = fieldSetFlags()[0] ? this.level : (org.kaaproject.kaa.server.flume.Level) defaultValue(fields()[0]);
record.tag = fieldSetFlags()[1] ? this.tag : (java.lang.CharSequence) defaultValue(fields()[1]);
record.message = fieldSetFlags()[2] ? this.message : (java.lang.CharSequence) defaultValue(fields()[2]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}