/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.kaaproject.kaa.common.endpoint.gen;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class EventListenersRequest 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\":\"EventListenersRequest\",\"namespace\":\"org.kaaproject.kaa.common.endpoint.gen\",\"fields\":[{\"name\":\"requestId\",\"type\":\"int\"},{\"name\":\"eventClassFQNs\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}}],\"direction\":\"out\"}");
private int requestId;
private java.util.List<java.lang.String> eventClassFQNs;
/**
* 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 EventListenersRequest() {
}
/**
* All-args constructor.
*/
public EventListenersRequest(java.lang.Integer requestId, java.util.List<java.lang.String> eventClassFQNs) {
this.requestId = requestId;
this.eventClassFQNs = eventClassFQNs;
}
public static org.apache.avro.Schema getClassSchema() {
return SCHEMA$;
}
/**
* Creates a new EventListenersRequest RecordBuilder
*/
public static org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest.Builder newBuilder() {
return new org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest.Builder();
}
/**
* Creates a new EventListenersRequest RecordBuilder by copying an existing Builder
*/
public static org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest.Builder other) {
return new org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest.Builder(other);
}
/**
* Creates a new EventListenersRequest RecordBuilder by copying an existing EventListenersRequest
* instance
*/
public static org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest other) {
return new org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest.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 requestId;
case 1:
return eventClassFQNs;
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:
requestId = (java.lang.Integer) value$;
break;
case 1:
eventClassFQNs = (java.util.List<java.lang.String>) value$;
break;
default:
throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'requestId' field.
*/
public java.lang.Integer getRequestId() {
return requestId;
}
/**
* Sets the value of the 'requestId' field.
*
* @param value the value to set.
*/
public void setRequestId(java.lang.Integer value) {
this.requestId = value;
}
/**
* Gets the value of the 'eventClassFQNs' field.
*/
public java.util.List<java.lang.String> getEventClassFQNs() {
return eventClassFQNs;
}
/**
* Sets the value of the 'eventClassFQNs' field.
*
* @param value the value to set.
*/
public void setEventClassFQNs(java.util.List<java.lang.String> value) {
this.eventClassFQNs = value;
}
/**
* RecordBuilder for EventListenersRequest instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<EventListenersRequest>
implements org.apache.avro.data.RecordBuilder<EventListenersRequest> {
private int requestId;
private java.util.List<java.lang.String> eventClassFQNs;
/**
* Creates a new Builder
*/
private Builder() {
super(org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest.SCHEMA$);
}
/**
* Creates a Builder by copying an existing Builder
*/
private Builder(org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest.Builder other) {
super(other);
if (isValidValue(fields()[0], other.requestId)) {
this.requestId = data().deepCopy(fields()[0].schema(), other.requestId);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.eventClassFQNs)) {
this.eventClassFQNs = data().deepCopy(fields()[1].schema(), other.eventClassFQNs);
fieldSetFlags()[1] = true;
}
}
/**
* Creates a Builder by copying an existing EventListenersRequest instance
*/
private Builder(org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest other) {
super(org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest.SCHEMA$);
if (isValidValue(fields()[0], other.requestId)) {
this.requestId = data().deepCopy(fields()[0].schema(), other.requestId);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.eventClassFQNs)) {
this.eventClassFQNs = data().deepCopy(fields()[1].schema(), other.eventClassFQNs);
fieldSetFlags()[1] = true;
}
}
/**
* Gets the value of the 'requestId' field
*/
public java.lang.Integer getRequestId() {
return requestId;
}
/**
* Sets the value of the 'requestId' field
*/
public org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest.Builder setRequestId(int value) {
validate(fields()[0], value);
this.requestId = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'requestId' field has been set
*/
public boolean hasRequestId() {
return fieldSetFlags()[0];
}
/**
* Clears the value of the 'requestId' field
*/
public org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest.Builder clearRequestId() {
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'eventClassFQNs' field
*/
public java.util.List<java.lang.String> getEventClassFQNs() {
return eventClassFQNs;
}
/**
* Sets the value of the 'eventClassFQNs' field
*/
public org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest.Builder setEventClassFQNs(java.util.List<java.lang.String> value) {
validate(fields()[1], value);
this.eventClassFQNs = value;
fieldSetFlags()[1] = true;
return this;
}
/**
* Checks whether the 'eventClassFQNs' field has been set
*/
public boolean hasEventClassFQNs() {
return fieldSetFlags()[1];
}
/**
* Clears the value of the 'eventClassFQNs' field
*/
public org.kaaproject.kaa.common.endpoint.gen.EventListenersRequest.Builder clearEventClassFQNs() {
eventClassFQNs = null;
fieldSetFlags()[1] = false;
return this;
}
@Override
public EventListenersRequest build() {
try {
EventListenersRequest record = new EventListenersRequest();
record.requestId = fieldSetFlags()[0] ? this.requestId : (java.lang.Integer) defaultValue(fields()[0]);
record.eventClassFQNs = fieldSetFlags()[1] ? this.eventClassFQNs : (java.util.List<java.lang.String>) defaultValue(fields()[1]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}