/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.kaaproject.kaa.server.common.zk.gen;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class TransportMetaData 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\":\"TransportMetaData\",\"namespace\":\"org.kaaproject.kaa.server.common.zk.gen\",\"fields\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"minSupportedVersion\",\"type\":\"int\"},{\"name\":\"maxSupportedVersion\",\"type\":\"int\"},{\"name\":\"connectionInfo\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"VersionConnectionInfoPair\",\"fields\":[{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"conenctionInfo\",\"type\":\"bytes\"}]}}}]}");
private int id;
private int minSupportedVersion;
private int maxSupportedVersion;
private java.util.List<org.kaaproject.kaa.server.common.zk.gen.VersionConnectionInfoPair> connectionInfo;
/**
* 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 TransportMetaData() {
}
/**
* All-args constructor.
*/
public TransportMetaData(java.lang.Integer id, java.lang.Integer minSupportedVersion, java.lang.Integer maxSupportedVersion, java.util.List<org.kaaproject.kaa.server.common.zk.gen.VersionConnectionInfoPair> connectionInfo) {
this.id = id;
this.minSupportedVersion = minSupportedVersion;
this.maxSupportedVersion = maxSupportedVersion;
this.connectionInfo = connectionInfo;
}
public static org.apache.avro.Schema getClassSchema() {
return SCHEMA$;
}
/**
* Creates a new TransportMetaData RecordBuilder
*/
public static org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.Builder newBuilder() {
return new org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.Builder();
}
/**
* Creates a new TransportMetaData RecordBuilder by copying an existing Builder
*/
public static org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.Builder newBuilder(org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.Builder other) {
return new org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.Builder(other);
}
/**
* Creates a new TransportMetaData RecordBuilder by copying an existing TransportMetaData instance
*/
public static org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.Builder newBuilder(org.kaaproject.kaa.server.common.zk.gen.TransportMetaData other) {
return new org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.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 id;
case 1:
return minSupportedVersion;
case 2:
return maxSupportedVersion;
case 3:
return connectionInfo;
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:
id = (java.lang.Integer) value$;
break;
case 1:
minSupportedVersion = (java.lang.Integer) value$;
break;
case 2:
maxSupportedVersion = (java.lang.Integer) value$;
break;
case 3:
connectionInfo = (java.util.List<org.kaaproject.kaa.server.common.zk.gen.VersionConnectionInfoPair>) value$;
break;
default:
throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'id' field.
*/
public java.lang.Integer getId() {
return id;
}
/**
* Sets the value of the 'id' field.
*
* @param value the value to set.
*/
public void setId(java.lang.Integer value) {
this.id = value;
}
/**
* Gets the value of the 'minSupportedVersion' field.
*/
public java.lang.Integer getMinSupportedVersion() {
return minSupportedVersion;
}
/**
* Sets the value of the 'minSupportedVersion' field.
*
* @param value the value to set.
*/
public void setMinSupportedVersion(java.lang.Integer value) {
this.minSupportedVersion = value;
}
/**
* Gets the value of the 'maxSupportedVersion' field.
*/
public java.lang.Integer getMaxSupportedVersion() {
return maxSupportedVersion;
}
/**
* Sets the value of the 'maxSupportedVersion' field.
*
* @param value the value to set.
*/
public void setMaxSupportedVersion(java.lang.Integer value) {
this.maxSupportedVersion = value;
}
/**
* Gets the value of the 'connectionInfo' field.
*/
public java.util.List<org.kaaproject.kaa.server.common.zk.gen.VersionConnectionInfoPair> getConnectionInfo() {
return connectionInfo;
}
/**
* Sets the value of the 'connectionInfo' field.
*
* @param value the value to set.
*/
public void setConnectionInfo(java.util.List<org.kaaproject.kaa.server.common.zk.gen.VersionConnectionInfoPair> value) {
this.connectionInfo = value;
}
/**
* RecordBuilder for TransportMetaData instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<TransportMetaData>
implements org.apache.avro.data.RecordBuilder<TransportMetaData> {
private int id;
private int minSupportedVersion;
private int maxSupportedVersion;
private java.util.List<org.kaaproject.kaa.server.common.zk.gen.VersionConnectionInfoPair> connectionInfo;
/**
* Creates a new Builder
*/
private Builder() {
super(org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.SCHEMA$);
}
/**
* Creates a Builder by copying an existing Builder
*/
private Builder(org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.Builder other) {
super(other);
if (isValidValue(fields()[0], other.id)) {
this.id = data().deepCopy(fields()[0].schema(), other.id);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.minSupportedVersion)) {
this.minSupportedVersion = data().deepCopy(fields()[1].schema(), other.minSupportedVersion);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.maxSupportedVersion)) {
this.maxSupportedVersion = data().deepCopy(fields()[2].schema(), other.maxSupportedVersion);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.connectionInfo)) {
this.connectionInfo = data().deepCopy(fields()[3].schema(), other.connectionInfo);
fieldSetFlags()[3] = true;
}
}
/**
* Creates a Builder by copying an existing TransportMetaData instance
*/
private Builder(org.kaaproject.kaa.server.common.zk.gen.TransportMetaData other) {
super(org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.SCHEMA$);
if (isValidValue(fields()[0], other.id)) {
this.id = data().deepCopy(fields()[0].schema(), other.id);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.minSupportedVersion)) {
this.minSupportedVersion = data().deepCopy(fields()[1].schema(), other.minSupportedVersion);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.maxSupportedVersion)) {
this.maxSupportedVersion = data().deepCopy(fields()[2].schema(), other.maxSupportedVersion);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.connectionInfo)) {
this.connectionInfo = data().deepCopy(fields()[3].schema(), other.connectionInfo);
fieldSetFlags()[3] = true;
}
}
/**
* Gets the value of the 'id' field
*/
public java.lang.Integer getId() {
return id;
}
/**
* Sets the value of the 'id' field
*/
public org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.Builder setId(int value) {
validate(fields()[0], value);
this.id = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'id' field has been set
*/
public boolean hasId() {
return fieldSetFlags()[0];
}
/**
* Clears the value of the 'id' field
*/
public org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.Builder clearId() {
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'minSupportedVersion' field
*/
public java.lang.Integer getMinSupportedVersion() {
return minSupportedVersion;
}
/**
* Sets the value of the 'minSupportedVersion' field
*/
public org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.Builder setMinSupportedVersion(int value) {
validate(fields()[1], value);
this.minSupportedVersion = value;
fieldSetFlags()[1] = true;
return this;
}
/**
* Checks whether the 'minSupportedVersion' field has been set
*/
public boolean hasMinSupportedVersion() {
return fieldSetFlags()[1];
}
/**
* Clears the value of the 'minSupportedVersion' field
*/
public org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.Builder clearMinSupportedVersion() {
fieldSetFlags()[1] = false;
return this;
}
/**
* Gets the value of the 'maxSupportedVersion' field
*/
public java.lang.Integer getMaxSupportedVersion() {
return maxSupportedVersion;
}
/**
* Sets the value of the 'maxSupportedVersion' field
*/
public org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.Builder setMaxSupportedVersion(int value) {
validate(fields()[2], value);
this.maxSupportedVersion = value;
fieldSetFlags()[2] = true;
return this;
}
/**
* Checks whether the 'maxSupportedVersion' field has been set
*/
public boolean hasMaxSupportedVersion() {
return fieldSetFlags()[2];
}
/**
* Clears the value of the 'maxSupportedVersion' field
*/
public org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.Builder clearMaxSupportedVersion() {
fieldSetFlags()[2] = false;
return this;
}
/**
* Gets the value of the 'connectionInfo' field
*/
public java.util.List<org.kaaproject.kaa.server.common.zk.gen.VersionConnectionInfoPair> getConnectionInfo() {
return connectionInfo;
}
/**
* Sets the value of the 'connectionInfo' field
*/
public org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.Builder setConnectionInfo(java.util.List<org.kaaproject.kaa.server.common.zk.gen.VersionConnectionInfoPair> value) {
validate(fields()[3], value);
this.connectionInfo = value;
fieldSetFlags()[3] = true;
return this;
}
/**
* Checks whether the 'connectionInfo' field has been set
*/
public boolean hasConnectionInfo() {
return fieldSetFlags()[3];
}
/**
* Clears the value of the 'connectionInfo' field
*/
public org.kaaproject.kaa.server.common.zk.gen.TransportMetaData.Builder clearConnectionInfo() {
connectionInfo = null;
fieldSetFlags()[3] = false;
return this;
}
@Override
public TransportMetaData build() {
try {
TransportMetaData record = new TransportMetaData();
record.id = fieldSetFlags()[0] ? this.id : (java.lang.Integer) defaultValue(fields()[0]);
record.minSupportedVersion = fieldSetFlags()[1] ? this.minSupportedVersion : (java.lang.Integer) defaultValue(fields()[1]);
record.maxSupportedVersion = fieldSetFlags()[2] ? this.maxSupportedVersion : (java.lang.Integer) defaultValue(fields()[2]);
record.connectionInfo = fieldSetFlags()[3] ? this.connectionInfo : (java.util.List<org.kaaproject.kaa.server.common.zk.gen.VersionConnectionInfoPair>) defaultValue(fields()[3]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}