/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.kaaproject.kaa.common.endpoint.gen;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class LogEntry 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\":\"LogEntry\",\"namespace\":\"org.kaaproject.kaa.common.endpoint.gen\",\"fields\":[{\"name\":\"data\",\"type\":\"bytes\"}],\"direction\":\"out\"}");
private java.nio.ByteBuffer data;
/**
* 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 LogEntry() {
}
/**
* All-args constructor.
*/
public LogEntry(java.nio.ByteBuffer data) {
this.data = data;
}
public static org.apache.avro.Schema getClassSchema() {
return SCHEMA$;
}
/**
* Creates a new LogEntry RecordBuilder
*/
public static org.kaaproject.kaa.common.endpoint.gen.LogEntry.Builder newBuilder() {
return new org.kaaproject.kaa.common.endpoint.gen.LogEntry.Builder();
}
/**
* Creates a new LogEntry RecordBuilder by copying an existing Builder
*/
public static org.kaaproject.kaa.common.endpoint.gen.LogEntry.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.LogEntry.Builder other) {
return new org.kaaproject.kaa.common.endpoint.gen.LogEntry.Builder(other);
}
/**
* Creates a new LogEntry RecordBuilder by copying an existing LogEntry instance
*/
public static org.kaaproject.kaa.common.endpoint.gen.LogEntry.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.LogEntry other) {
return new org.kaaproject.kaa.common.endpoint.gen.LogEntry.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 data;
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:
data = (java.nio.ByteBuffer) value$;
break;
default:
throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* 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;
}
/**
* RecordBuilder for LogEntry instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<LogEntry>
implements org.apache.avro.data.RecordBuilder<LogEntry> {
private java.nio.ByteBuffer data;
/**
* Creates a new Builder
*/
private Builder() {
super(org.kaaproject.kaa.common.endpoint.gen.LogEntry.SCHEMA$);
}
/**
* Creates a Builder by copying an existing Builder
*/
private Builder(org.kaaproject.kaa.common.endpoint.gen.LogEntry.Builder other) {
super(other);
if (isValidValue(fields()[0], other.data)) {
this.data = data().deepCopy(fields()[0].schema(), other.data);
fieldSetFlags()[0] = true;
}
}
/**
* Creates a Builder by copying an existing LogEntry instance
*/
private Builder(org.kaaproject.kaa.common.endpoint.gen.LogEntry other) {
super(org.kaaproject.kaa.common.endpoint.gen.LogEntry.SCHEMA$);
if (isValidValue(fields()[0], other.data)) {
this.data = data().deepCopy(fields()[0].schema(), other.data);
fieldSetFlags()[0] = true;
}
}
/**
* Gets the value of the 'data' field
*/
public java.nio.ByteBuffer getData() {
return data;
}
/**
* Sets the value of the 'data' field
*/
public org.kaaproject.kaa.common.endpoint.gen.LogEntry.Builder setData(java.nio.ByteBuffer value) {
validate(fields()[0], value);
this.data = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'data' field has been set
*/
public boolean hasData() {
return fieldSetFlags()[0];
}
/**
* Clears the value of the 'data' field
*/
public org.kaaproject.kaa.common.endpoint.gen.LogEntry.Builder clearData() {
data = null;
fieldSetFlags()[0] = false;
return this;
}
@Override
public LogEntry build() {
try {
LogEntry record = new LogEntry();
record.data = fieldSetFlags()[0] ? this.data : (java.nio.ByteBuffer) defaultValue(fields()[0]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}