/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package org.kaaproject.kaa.server.appenders.cassandra.config.gen; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class CassandraSocketOption 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\":\"CassandraSocketOption\",\"namespace\":\"org.kaaproject.kaa.server.appenders.cassandra.config.gen\",\"fields\":[{\"name\":\"sendBufferSize\",\"type\":[\"int\",\"null\"],\"displayName\":\"Set send buffer size\",\"by_default\":8192,\"optional\":true},{\"name\":\"receiveBufferSize\",\"type\":[\"int\",\"null\"],\"displayName\":\"Set receive buffer size\",\"by_default\":8192,\"optional\":true},{\"name\":\"soLinger\",\"type\":[\"int\",\"null\"],\"displayName\":\"Delay before a reset is sent\",\"by_default\":0,\"optional\":true},{\"name\":\"connectionTimeout\",\"type\":[\"int\",\"null\"],\"displayName\":\"Connection timeout (ms)\",\"by_default\":5000,\"optional\":true},{\"name\":\"readTimeout\",\"type\":[\"int\",\"null\"],\"displayName\":\"Read timeout (ms)\",\"by_default\":12000,\"optional\":true},{\"name\":\"reuseAddress\",\"type\":[\"boolean\",\"null\"],\"displayName\":\"Reuse address\",\"by_default\":false,\"optional\":true},{\"name\":\"keepAlive\",\"type\":[\"boolean\",\"null\"],\"displayName\":\"Use keep alive\",\"by_default\":false,\"optional\":true},{\"name\":\"tcpNoDelay\",\"type\":[\"boolean\",\"null\"],\"displayName\":\"Tcp no delay\",\"by_default\":false,\"optional\":true}]}"); private java.lang.Integer sendBufferSize; private java.lang.Integer receiveBufferSize; private java.lang.Integer soLinger; private java.lang.Integer connectionTimeout; private java.lang.Integer readTimeout; private java.lang.Boolean reuseAddress; private java.lang.Boolean keepAlive; private java.lang.Boolean tcpNoDelay; /** * 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 CassandraSocketOption() { } /** * All-args constructor. */ public CassandraSocketOption(java.lang.Integer sendBufferSize, java.lang.Integer receiveBufferSize, java.lang.Integer soLinger, java.lang.Integer connectionTimeout, java.lang.Integer readTimeout, java.lang.Boolean reuseAddress, java.lang.Boolean keepAlive, java.lang.Boolean tcpNoDelay) { this.sendBufferSize = sendBufferSize; this.receiveBufferSize = receiveBufferSize; this.soLinger = soLinger; this.connectionTimeout = connectionTimeout; this.readTimeout = readTimeout; this.reuseAddress = reuseAddress; this.keepAlive = keepAlive; this.tcpNoDelay = tcpNoDelay; } public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } /** * Creates a new CassandraSocketOption RecordBuilder */ public static org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder newBuilder() { return new org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder(); } /** * Creates a new CassandraSocketOption RecordBuilder by copying an existing Builder */ public static org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder newBuilder(org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder other) { return new org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder(other); } /** * Creates a new CassandraSocketOption RecordBuilder by copying an existing CassandraSocketOption * instance */ public static org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder newBuilder(org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption other) { return new org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.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 sendBufferSize; case 1: return receiveBufferSize; case 2: return soLinger; case 3: return connectionTimeout; case 4: return readTimeout; case 5: return reuseAddress; case 6: return keepAlive; case 7: return tcpNoDelay; 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: sendBufferSize = (java.lang.Integer) value$; break; case 1: receiveBufferSize = (java.lang.Integer) value$; break; case 2: soLinger = (java.lang.Integer) value$; break; case 3: connectionTimeout = (java.lang.Integer) value$; break; case 4: readTimeout = (java.lang.Integer) value$; break; case 5: reuseAddress = (java.lang.Boolean) value$; break; case 6: keepAlive = (java.lang.Boolean) value$; break; case 7: tcpNoDelay = (java.lang.Boolean) value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'sendBufferSize' field. */ public java.lang.Integer getSendBufferSize() { return sendBufferSize; } /** * Sets the value of the 'sendBufferSize' field. * * @param value the value to set. */ public void setSendBufferSize(java.lang.Integer value) { this.sendBufferSize = value; } /** * Gets the value of the 'receiveBufferSize' field. */ public java.lang.Integer getReceiveBufferSize() { return receiveBufferSize; } /** * Sets the value of the 'receiveBufferSize' field. * * @param value the value to set. */ public void setReceiveBufferSize(java.lang.Integer value) { this.receiveBufferSize = value; } /** * Gets the value of the 'soLinger' field. */ public java.lang.Integer getSoLinger() { return soLinger; } /** * Sets the value of the 'soLinger' field. * * @param value the value to set. */ public void setSoLinger(java.lang.Integer value) { this.soLinger = value; } /** * Gets the value of the 'connectionTimeout' field. */ public java.lang.Integer getConnectionTimeout() { return connectionTimeout; } /** * Sets the value of the 'connectionTimeout' field. * * @param value the value to set. */ public void setConnectionTimeout(java.lang.Integer value) { this.connectionTimeout = value; } /** * Gets the value of the 'readTimeout' field. */ public java.lang.Integer getReadTimeout() { return readTimeout; } /** * Sets the value of the 'readTimeout' field. * * @param value the value to set. */ public void setReadTimeout(java.lang.Integer value) { this.readTimeout = value; } /** * Gets the value of the 'reuseAddress' field. */ public java.lang.Boolean getReuseAddress() { return reuseAddress; } /** * Sets the value of the 'reuseAddress' field. * * @param value the value to set. */ public void setReuseAddress(java.lang.Boolean value) { this.reuseAddress = value; } /** * Gets the value of the 'keepAlive' field. */ public java.lang.Boolean getKeepAlive() { return keepAlive; } /** * Sets the value of the 'keepAlive' field. * * @param value the value to set. */ public void setKeepAlive(java.lang.Boolean value) { this.keepAlive = value; } /** * Gets the value of the 'tcpNoDelay' field. */ public java.lang.Boolean getTcpNoDelay() { return tcpNoDelay; } /** * Sets the value of the 'tcpNoDelay' field. * * @param value the value to set. */ public void setTcpNoDelay(java.lang.Boolean value) { this.tcpNoDelay = value; } /** * RecordBuilder for CassandraSocketOption instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<CassandraSocketOption> implements org.apache.avro.data.RecordBuilder<CassandraSocketOption> { private java.lang.Integer sendBufferSize; private java.lang.Integer receiveBufferSize; private java.lang.Integer soLinger; private java.lang.Integer connectionTimeout; private java.lang.Integer readTimeout; private java.lang.Boolean reuseAddress; private java.lang.Boolean keepAlive; private java.lang.Boolean tcpNoDelay; /** * Creates a new Builder */ private Builder() { super(org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.SCHEMA$); } /** * Creates a Builder by copying an existing Builder */ private Builder(org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder other) { super(other); if (isValidValue(fields()[0], other.sendBufferSize)) { this.sendBufferSize = data().deepCopy(fields()[0].schema(), other.sendBufferSize); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.receiveBufferSize)) { this.receiveBufferSize = data().deepCopy(fields()[1].schema(), other.receiveBufferSize); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.soLinger)) { this.soLinger = data().deepCopy(fields()[2].schema(), other.soLinger); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.connectionTimeout)) { this.connectionTimeout = data().deepCopy(fields()[3].schema(), other.connectionTimeout); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.readTimeout)) { this.readTimeout = data().deepCopy(fields()[4].schema(), other.readTimeout); fieldSetFlags()[4] = true; } if (isValidValue(fields()[5], other.reuseAddress)) { this.reuseAddress = data().deepCopy(fields()[5].schema(), other.reuseAddress); fieldSetFlags()[5] = true; } if (isValidValue(fields()[6], other.keepAlive)) { this.keepAlive = data().deepCopy(fields()[6].schema(), other.keepAlive); fieldSetFlags()[6] = true; } if (isValidValue(fields()[7], other.tcpNoDelay)) { this.tcpNoDelay = data().deepCopy(fields()[7].schema(), other.tcpNoDelay); fieldSetFlags()[7] = true; } } /** * Creates a Builder by copying an existing CassandraSocketOption instance */ private Builder(org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption other) { super(org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.SCHEMA$); if (isValidValue(fields()[0], other.sendBufferSize)) { this.sendBufferSize = data().deepCopy(fields()[0].schema(), other.sendBufferSize); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.receiveBufferSize)) { this.receiveBufferSize = data().deepCopy(fields()[1].schema(), other.receiveBufferSize); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.soLinger)) { this.soLinger = data().deepCopy(fields()[2].schema(), other.soLinger); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.connectionTimeout)) { this.connectionTimeout = data().deepCopy(fields()[3].schema(), other.connectionTimeout); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.readTimeout)) { this.readTimeout = data().deepCopy(fields()[4].schema(), other.readTimeout); fieldSetFlags()[4] = true; } if (isValidValue(fields()[5], other.reuseAddress)) { this.reuseAddress = data().deepCopy(fields()[5].schema(), other.reuseAddress); fieldSetFlags()[5] = true; } if (isValidValue(fields()[6], other.keepAlive)) { this.keepAlive = data().deepCopy(fields()[6].schema(), other.keepAlive); fieldSetFlags()[6] = true; } if (isValidValue(fields()[7], other.tcpNoDelay)) { this.tcpNoDelay = data().deepCopy(fields()[7].schema(), other.tcpNoDelay); fieldSetFlags()[7] = true; } } /** * Gets the value of the 'sendBufferSize' field */ public java.lang.Integer getSendBufferSize() { return sendBufferSize; } /** * Sets the value of the 'sendBufferSize' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder setSendBufferSize(java.lang.Integer value) { validate(fields()[0], value); this.sendBufferSize = value; fieldSetFlags()[0] = true; return this; } /** * Checks whether the 'sendBufferSize' field has been set */ public boolean hasSendBufferSize() { return fieldSetFlags()[0]; } /** * Clears the value of the 'sendBufferSize' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder clearSendBufferSize() { sendBufferSize = null; fieldSetFlags()[0] = false; return this; } /** * Gets the value of the 'receiveBufferSize' field */ public java.lang.Integer getReceiveBufferSize() { return receiveBufferSize; } /** * Sets the value of the 'receiveBufferSize' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder setReceiveBufferSize(java.lang.Integer value) { validate(fields()[1], value); this.receiveBufferSize = value; fieldSetFlags()[1] = true; return this; } /** * Checks whether the 'receiveBufferSize' field has been set */ public boolean hasReceiveBufferSize() { return fieldSetFlags()[1]; } /** * Clears the value of the 'receiveBufferSize' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder clearReceiveBufferSize() { receiveBufferSize = null; fieldSetFlags()[1] = false; return this; } /** * Gets the value of the 'soLinger' field */ public java.lang.Integer getSoLinger() { return soLinger; } /** * Sets the value of the 'soLinger' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder setSoLinger(java.lang.Integer value) { validate(fields()[2], value); this.soLinger = value; fieldSetFlags()[2] = true; return this; } /** * Checks whether the 'soLinger' field has been set */ public boolean hasSoLinger() { return fieldSetFlags()[2]; } /** * Clears the value of the 'soLinger' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder clearSoLinger() { soLinger = null; fieldSetFlags()[2] = false; return this; } /** * Gets the value of the 'connectionTimeout' field */ public java.lang.Integer getConnectionTimeout() { return connectionTimeout; } /** * Sets the value of the 'connectionTimeout' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder setConnectionTimeout(java.lang.Integer value) { validate(fields()[3], value); this.connectionTimeout = value; fieldSetFlags()[3] = true; return this; } /** * Checks whether the 'connectionTimeout' field has been set */ public boolean hasConnectionTimeout() { return fieldSetFlags()[3]; } /** * Clears the value of the 'connectionTimeout' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder clearConnectionTimeout() { connectionTimeout = null; fieldSetFlags()[3] = false; return this; } /** * Gets the value of the 'readTimeout' field */ public java.lang.Integer getReadTimeout() { return readTimeout; } /** * Sets the value of the 'readTimeout' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder setReadTimeout(java.lang.Integer value) { validate(fields()[4], value); this.readTimeout = value; fieldSetFlags()[4] = true; return this; } /** * Checks whether the 'readTimeout' field has been set */ public boolean hasReadTimeout() { return fieldSetFlags()[4]; } /** * Clears the value of the 'readTimeout' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder clearReadTimeout() { readTimeout = null; fieldSetFlags()[4] = false; return this; } /** * Gets the value of the 'reuseAddress' field */ public java.lang.Boolean getReuseAddress() { return reuseAddress; } /** * Sets the value of the 'reuseAddress' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder setReuseAddress(java.lang.Boolean value) { validate(fields()[5], value); this.reuseAddress = value; fieldSetFlags()[5] = true; return this; } /** * Checks whether the 'reuseAddress' field has been set */ public boolean hasReuseAddress() { return fieldSetFlags()[5]; } /** * Clears the value of the 'reuseAddress' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder clearReuseAddress() { reuseAddress = null; fieldSetFlags()[5] = false; return this; } /** * Gets the value of the 'keepAlive' field */ public java.lang.Boolean getKeepAlive() { return keepAlive; } /** * Sets the value of the 'keepAlive' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder setKeepAlive(java.lang.Boolean value) { validate(fields()[6], value); this.keepAlive = value; fieldSetFlags()[6] = true; return this; } /** * Checks whether the 'keepAlive' field has been set */ public boolean hasKeepAlive() { return fieldSetFlags()[6]; } /** * Clears the value of the 'keepAlive' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder clearKeepAlive() { keepAlive = null; fieldSetFlags()[6] = false; return this; } /** * Gets the value of the 'tcpNoDelay' field */ public java.lang.Boolean getTcpNoDelay() { return tcpNoDelay; } /** * Sets the value of the 'tcpNoDelay' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder setTcpNoDelay(java.lang.Boolean value) { validate(fields()[7], value); this.tcpNoDelay = value; fieldSetFlags()[7] = true; return this; } /** * Checks whether the 'tcpNoDelay' field has been set */ public boolean hasTcpNoDelay() { return fieldSetFlags()[7]; } /** * Clears the value of the 'tcpNoDelay' field */ public org.kaaproject.kaa.server.appenders.cassandra.config.gen.CassandraSocketOption.Builder clearTcpNoDelay() { tcpNoDelay = null; fieldSetFlags()[7] = false; return this; } @Override public CassandraSocketOption build() { try { CassandraSocketOption record = new CassandraSocketOption(); record.sendBufferSize = fieldSetFlags()[0] ? this.sendBufferSize : (java.lang.Integer) defaultValue(fields()[0]); record.receiveBufferSize = fieldSetFlags()[1] ? this.receiveBufferSize : (java.lang.Integer) defaultValue(fields()[1]); record.soLinger = fieldSetFlags()[2] ? this.soLinger : (java.lang.Integer) defaultValue(fields()[2]); record.connectionTimeout = fieldSetFlags()[3] ? this.connectionTimeout : (java.lang.Integer) defaultValue(fields()[3]); record.readTimeout = fieldSetFlags()[4] ? this.readTimeout : (java.lang.Integer) defaultValue(fields()[4]); record.reuseAddress = fieldSetFlags()[5] ? this.reuseAddress : (java.lang.Boolean) defaultValue(fields()[5]); record.keepAlive = fieldSetFlags()[6] ? this.keepAlive : (java.lang.Boolean) defaultValue(fields()[6]); record.tcpNoDelay = fieldSetFlags()[7] ? this.tcpNoDelay : (java.lang.Boolean) defaultValue(fields()[7]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }