com.networknt.controller.HealthCheck Maven / Gradle / Ivy
The newest version!
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package com.networknt.controller;
import org.apache.avro.generic.GenericArray;
import org.apache.avro.specific.SpecificData;
import org.apache.avro.util.Utf8;
import org.apache.avro.message.BinaryMessageEncoder;
import org.apache.avro.message.BinaryMessageDecoder;
import org.apache.avro.message.SchemaStore;
@org.apache.avro.specific.AvroGenerated
public class HealthCheck extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
private static final long serialVersionUID = -6697768552917720523L;
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"HealthCheck\",\"namespace\":\"com.networknt.controller\",\"fields\":[{\"name\":\"host\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"lastExecuteTimestamp\",\"type\":\"long\"},{\"name\":\"lastFailedTimestamp\",\"type\":\"long\"},{\"name\":\"serviceId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"tag\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"default\":null},{\"name\":\"protocol\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"address\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"port\",\"type\":\"int\"},{\"name\":\"tlsSkipVerify\",\"type\":\"boolean\"},{\"name\":\"interval\",\"type\":\"int\"},{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"deregisterCriticalServiceAfter\",\"type\":\"int\"},{\"name\":\"healthPath\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
private static final SpecificData MODEL$ = new SpecificData();
private static final BinaryMessageEncoder ENCODER =
new BinaryMessageEncoder<>(MODEL$, SCHEMA$);
private static final BinaryMessageDecoder DECODER =
new BinaryMessageDecoder<>(MODEL$, SCHEMA$);
/**
* Return the BinaryMessageEncoder instance used by this class.
* @return the message encoder used by this class
*/
public static BinaryMessageEncoder getEncoder() {
return ENCODER;
}
/**
* Return the BinaryMessageDecoder instance used by this class.
* @return the message decoder used by this class
*/
public static BinaryMessageDecoder getDecoder() {
return DECODER;
}
/**
* Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}.
* @param resolver a {@link SchemaStore} used to find schemas by fingerprint
* @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore
*/
public static BinaryMessageDecoder createDecoder(SchemaStore resolver) {
return new BinaryMessageDecoder<>(MODEL$, SCHEMA$, resolver);
}
/**
* Serializes this HealthCheck to a ByteBuffer.
* @return a buffer holding the serialized data for this instance
* @throws java.io.IOException if this instance could not be serialized
*/
public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException {
return ENCODER.encode(this);
}
/**
* Deserializes a HealthCheck from a ByteBuffer.
* @param b a byte buffer holding serialized data for an instance of this class
* @return a HealthCheck instance decoded from the given buffer
* @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class
*/
public static HealthCheck fromByteBuffer(
java.nio.ByteBuffer b) throws java.io.IOException {
return DECODER.decode(b);
}
private java.lang.String host;
private long lastExecuteTimestamp;
private long lastFailedTimestamp;
private java.lang.String serviceId;
private java.lang.String tag;
private java.lang.String protocol;
private java.lang.String address;
private int port;
private boolean tlsSkipVerify;
private int interval;
private java.lang.String id;
private int deregisterCriticalServiceAfter;
private java.lang.String healthPath;
/**
* Default constructor. Note that this does not initialize fields
* to their default values from the schema. If that is desired then
* one should use newBuilder()
.
*/
public HealthCheck() {}
/**
* All-args constructor.
* @param host The new value for host
* @param lastExecuteTimestamp The new value for lastExecuteTimestamp
* @param lastFailedTimestamp The new value for lastFailedTimestamp
* @param serviceId The new value for serviceId
* @param tag The new value for tag
* @param protocol The new value for protocol
* @param address The new value for address
* @param port The new value for port
* @param tlsSkipVerify The new value for tlsSkipVerify
* @param interval The new value for interval
* @param id The new value for id
* @param deregisterCriticalServiceAfter The new value for deregisterCriticalServiceAfter
* @param healthPath The new value for healthPath
*/
public HealthCheck(java.lang.String host, java.lang.Long lastExecuteTimestamp, java.lang.Long lastFailedTimestamp, java.lang.String serviceId, java.lang.String tag, java.lang.String protocol, java.lang.String address, java.lang.Integer port, java.lang.Boolean tlsSkipVerify, java.lang.Integer interval, java.lang.String id, java.lang.Integer deregisterCriticalServiceAfter, java.lang.String healthPath) {
this.host = host;
this.lastExecuteTimestamp = lastExecuteTimestamp;
this.lastFailedTimestamp = lastFailedTimestamp;
this.serviceId = serviceId;
this.tag = tag;
this.protocol = protocol;
this.address = address;
this.port = port;
this.tlsSkipVerify = tlsSkipVerify;
this.interval = interval;
this.id = id;
this.deregisterCriticalServiceAfter = deregisterCriticalServiceAfter;
this.healthPath = healthPath;
}
@Override
public org.apache.avro.specific.SpecificData getSpecificData() { return MODEL$; }
@Override
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
// Used by DatumWriter. Applications should not call.
@Override
public java.lang.Object get(int field$) {
switch (field$) {
case 0: return host;
case 1: return lastExecuteTimestamp;
case 2: return lastFailedTimestamp;
case 3: return serviceId;
case 4: return tag;
case 5: return protocol;
case 6: return address;
case 7: return port;
case 8: return tlsSkipVerify;
case 9: return interval;
case 10: return id;
case 11: return deregisterCriticalServiceAfter;
case 12: return healthPath;
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
}
}
// Used by DatumReader. Applications should not call.
@Override
@SuppressWarnings(value="unchecked")
public void put(int field$, java.lang.Object value$) {
switch (field$) {
case 0: host = value$ != null ? value$.toString() : null; break;
case 1: lastExecuteTimestamp = (java.lang.Long)value$; break;
case 2: lastFailedTimestamp = (java.lang.Long)value$; break;
case 3: serviceId = value$ != null ? value$.toString() : null; break;
case 4: tag = value$ != null ? value$.toString() : null; break;
case 5: protocol = value$ != null ? value$.toString() : null; break;
case 6: address = value$ != null ? value$.toString() : null; break;
case 7: port = (java.lang.Integer)value$; break;
case 8: tlsSkipVerify = (java.lang.Boolean)value$; break;
case 9: interval = (java.lang.Integer)value$; break;
case 10: id = value$ != null ? value$.toString() : null; break;
case 11: deregisterCriticalServiceAfter = (java.lang.Integer)value$; break;
case 12: healthPath = value$ != null ? value$.toString() : null; break;
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
}
}
/**
* Gets the value of the 'host' field.
* @return The value of the 'host' field.
*/
public java.lang.String getHost() {
return host;
}
/**
* Sets the value of the 'host' field.
* @param value the value to set.
*/
public void setHost(java.lang.String value) {
this.host = value;
}
/**
* Gets the value of the 'lastExecuteTimestamp' field.
* @return The value of the 'lastExecuteTimestamp' field.
*/
public long getLastExecuteTimestamp() {
return lastExecuteTimestamp;
}
/**
* Sets the value of the 'lastExecuteTimestamp' field.
* @param value the value to set.
*/
public void setLastExecuteTimestamp(long value) {
this.lastExecuteTimestamp = value;
}
/**
* Gets the value of the 'lastFailedTimestamp' field.
* @return The value of the 'lastFailedTimestamp' field.
*/
public long getLastFailedTimestamp() {
return lastFailedTimestamp;
}
/**
* Sets the value of the 'lastFailedTimestamp' field.
* @param value the value to set.
*/
public void setLastFailedTimestamp(long value) {
this.lastFailedTimestamp = value;
}
/**
* Gets the value of the 'serviceId' field.
* @return The value of the 'serviceId' field.
*/
public java.lang.String getServiceId() {
return serviceId;
}
/**
* Sets the value of the 'serviceId' field.
* @param value the value to set.
*/
public void setServiceId(java.lang.String value) {
this.serviceId = value;
}
/**
* Gets the value of the 'tag' field.
* @return The value of the 'tag' field.
*/
public java.lang.String getTag() {
return tag;
}
/**
* Sets the value of the 'tag' field.
* @param value the value to set.
*/
public void setTag(java.lang.String value) {
this.tag = value;
}
/**
* Gets the value of the 'protocol' field.
* @return The value of the 'protocol' field.
*/
public java.lang.String getProtocol() {
return protocol;
}
/**
* Sets the value of the 'protocol' field.
* @param value the value to set.
*/
public void setProtocol(java.lang.String value) {
this.protocol = value;
}
/**
* Gets the value of the 'address' field.
* @return The value of the 'address' field.
*/
public java.lang.String getAddress() {
return address;
}
/**
* Sets the value of the 'address' field.
* @param value the value to set.
*/
public void setAddress(java.lang.String value) {
this.address = value;
}
/**
* Gets the value of the 'port' field.
* @return The value of the 'port' field.
*/
public int getPort() {
return port;
}
/**
* Sets the value of the 'port' field.
* @param value the value to set.
*/
public void setPort(int value) {
this.port = value;
}
/**
* Gets the value of the 'tlsSkipVerify' field.
* @return The value of the 'tlsSkipVerify' field.
*/
public boolean getTlsSkipVerify() {
return tlsSkipVerify;
}
/**
* Sets the value of the 'tlsSkipVerify' field.
* @param value the value to set.
*/
public void setTlsSkipVerify(boolean value) {
this.tlsSkipVerify = value;
}
/**
* Gets the value of the 'interval' field.
* @return The value of the 'interval' field.
*/
public int getInterval() {
return interval;
}
/**
* Sets the value of the 'interval' field.
* @param value the value to set.
*/
public void setInterval(int value) {
this.interval = value;
}
/**
* Gets the value of the 'id' field.
* @return The value of the 'id' field.
*/
public java.lang.String getId() {
return id;
}
/**
* Sets the value of the 'id' field.
* @param value the value to set.
*/
public void setId(java.lang.String value) {
this.id = value;
}
/**
* Gets the value of the 'deregisterCriticalServiceAfter' field.
* @return The value of the 'deregisterCriticalServiceAfter' field.
*/
public int getDeregisterCriticalServiceAfter() {
return deregisterCriticalServiceAfter;
}
/**
* Sets the value of the 'deregisterCriticalServiceAfter' field.
* @param value the value to set.
*/
public void setDeregisterCriticalServiceAfter(int value) {
this.deregisterCriticalServiceAfter = value;
}
/**
* Gets the value of the 'healthPath' field.
* @return The value of the 'healthPath' field.
*/
public java.lang.String getHealthPath() {
return healthPath;
}
/**
* Sets the value of the 'healthPath' field.
* @param value the value to set.
*/
public void setHealthPath(java.lang.String value) {
this.healthPath = value;
}
/**
* Creates a new HealthCheck RecordBuilder.
* @return A new HealthCheck RecordBuilder
*/
public static com.networknt.controller.HealthCheck.Builder newBuilder() {
return new com.networknt.controller.HealthCheck.Builder();
}
/**
* Creates a new HealthCheck RecordBuilder by copying an existing Builder.
* @param other The existing builder to copy.
* @return A new HealthCheck RecordBuilder
*/
public static com.networknt.controller.HealthCheck.Builder newBuilder(com.networknt.controller.HealthCheck.Builder other) {
if (other == null) {
return new com.networknt.controller.HealthCheck.Builder();
} else {
return new com.networknt.controller.HealthCheck.Builder(other);
}
}
/**
* Creates a new HealthCheck RecordBuilder by copying an existing HealthCheck instance.
* @param other The existing instance to copy.
* @return A new HealthCheck RecordBuilder
*/
public static com.networknt.controller.HealthCheck.Builder newBuilder(com.networknt.controller.HealthCheck other) {
if (other == null) {
return new com.networknt.controller.HealthCheck.Builder();
} else {
return new com.networknt.controller.HealthCheck.Builder(other);
}
}
/**
* RecordBuilder for HealthCheck instances.
*/
@org.apache.avro.specific.AvroGenerated
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private java.lang.String host;
private long lastExecuteTimestamp;
private long lastFailedTimestamp;
private java.lang.String serviceId;
private java.lang.String tag;
private java.lang.String protocol;
private java.lang.String address;
private int port;
private boolean tlsSkipVerify;
private int interval;
private java.lang.String id;
private int deregisterCriticalServiceAfter;
private java.lang.String healthPath;
/** Creates a new Builder */
private Builder() {
super(SCHEMA$, MODEL$);
}
/**
* Creates a Builder by copying an existing Builder.
* @param other The existing Builder to copy.
*/
private Builder(com.networknt.controller.HealthCheck.Builder other) {
super(other);
if (isValidValue(fields()[0], other.host)) {
this.host = data().deepCopy(fields()[0].schema(), other.host);
fieldSetFlags()[0] = other.fieldSetFlags()[0];
}
if (isValidValue(fields()[1], other.lastExecuteTimestamp)) {
this.lastExecuteTimestamp = data().deepCopy(fields()[1].schema(), other.lastExecuteTimestamp);
fieldSetFlags()[1] = other.fieldSetFlags()[1];
}
if (isValidValue(fields()[2], other.lastFailedTimestamp)) {
this.lastFailedTimestamp = data().deepCopy(fields()[2].schema(), other.lastFailedTimestamp);
fieldSetFlags()[2] = other.fieldSetFlags()[2];
}
if (isValidValue(fields()[3], other.serviceId)) {
this.serviceId = data().deepCopy(fields()[3].schema(), other.serviceId);
fieldSetFlags()[3] = other.fieldSetFlags()[3];
}
if (isValidValue(fields()[4], other.tag)) {
this.tag = data().deepCopy(fields()[4].schema(), other.tag);
fieldSetFlags()[4] = other.fieldSetFlags()[4];
}
if (isValidValue(fields()[5], other.protocol)) {
this.protocol = data().deepCopy(fields()[5].schema(), other.protocol);
fieldSetFlags()[5] = other.fieldSetFlags()[5];
}
if (isValidValue(fields()[6], other.address)) {
this.address = data().deepCopy(fields()[6].schema(), other.address);
fieldSetFlags()[6] = other.fieldSetFlags()[6];
}
if (isValidValue(fields()[7], other.port)) {
this.port = data().deepCopy(fields()[7].schema(), other.port);
fieldSetFlags()[7] = other.fieldSetFlags()[7];
}
if (isValidValue(fields()[8], other.tlsSkipVerify)) {
this.tlsSkipVerify = data().deepCopy(fields()[8].schema(), other.tlsSkipVerify);
fieldSetFlags()[8] = other.fieldSetFlags()[8];
}
if (isValidValue(fields()[9], other.interval)) {
this.interval = data().deepCopy(fields()[9].schema(), other.interval);
fieldSetFlags()[9] = other.fieldSetFlags()[9];
}
if (isValidValue(fields()[10], other.id)) {
this.id = data().deepCopy(fields()[10].schema(), other.id);
fieldSetFlags()[10] = other.fieldSetFlags()[10];
}
if (isValidValue(fields()[11], other.deregisterCriticalServiceAfter)) {
this.deregisterCriticalServiceAfter = data().deepCopy(fields()[11].schema(), other.deregisterCriticalServiceAfter);
fieldSetFlags()[11] = other.fieldSetFlags()[11];
}
if (isValidValue(fields()[12], other.healthPath)) {
this.healthPath = data().deepCopy(fields()[12].schema(), other.healthPath);
fieldSetFlags()[12] = other.fieldSetFlags()[12];
}
}
/**
* Creates a Builder by copying an existing HealthCheck instance
* @param other The existing instance to copy.
*/
private Builder(com.networknt.controller.HealthCheck other) {
super(SCHEMA$, MODEL$);
if (isValidValue(fields()[0], other.host)) {
this.host = data().deepCopy(fields()[0].schema(), other.host);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.lastExecuteTimestamp)) {
this.lastExecuteTimestamp = data().deepCopy(fields()[1].schema(), other.lastExecuteTimestamp);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.lastFailedTimestamp)) {
this.lastFailedTimestamp = data().deepCopy(fields()[2].schema(), other.lastFailedTimestamp);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.serviceId)) {
this.serviceId = data().deepCopy(fields()[3].schema(), other.serviceId);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.tag)) {
this.tag = data().deepCopy(fields()[4].schema(), other.tag);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.protocol)) {
this.protocol = data().deepCopy(fields()[5].schema(), other.protocol);
fieldSetFlags()[5] = true;
}
if (isValidValue(fields()[6], other.address)) {
this.address = data().deepCopy(fields()[6].schema(), other.address);
fieldSetFlags()[6] = true;
}
if (isValidValue(fields()[7], other.port)) {
this.port = data().deepCopy(fields()[7].schema(), other.port);
fieldSetFlags()[7] = true;
}
if (isValidValue(fields()[8], other.tlsSkipVerify)) {
this.tlsSkipVerify = data().deepCopy(fields()[8].schema(), other.tlsSkipVerify);
fieldSetFlags()[8] = true;
}
if (isValidValue(fields()[9], other.interval)) {
this.interval = data().deepCopy(fields()[9].schema(), other.interval);
fieldSetFlags()[9] = true;
}
if (isValidValue(fields()[10], other.id)) {
this.id = data().deepCopy(fields()[10].schema(), other.id);
fieldSetFlags()[10] = true;
}
if (isValidValue(fields()[11], other.deregisterCriticalServiceAfter)) {
this.deregisterCriticalServiceAfter = data().deepCopy(fields()[11].schema(), other.deregisterCriticalServiceAfter);
fieldSetFlags()[11] = true;
}
if (isValidValue(fields()[12], other.healthPath)) {
this.healthPath = data().deepCopy(fields()[12].schema(), other.healthPath);
fieldSetFlags()[12] = true;
}
}
/**
* Gets the value of the 'host' field.
* @return The value.
*/
public java.lang.String getHost() {
return host;
}
/**
* Sets the value of the 'host' field.
* @param value The value of 'host'.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder setHost(java.lang.String value) {
validate(fields()[0], value);
this.host = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'host' field has been set.
* @return True if the 'host' field has been set, false otherwise.
*/
public boolean hasHost() {
return fieldSetFlags()[0];
}
/**
* Clears the value of the 'host' field.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder clearHost() {
host = null;
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'lastExecuteTimestamp' field.
* @return The value.
*/
public long getLastExecuteTimestamp() {
return lastExecuteTimestamp;
}
/**
* Sets the value of the 'lastExecuteTimestamp' field.
* @param value The value of 'lastExecuteTimestamp'.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder setLastExecuteTimestamp(long value) {
validate(fields()[1], value);
this.lastExecuteTimestamp = value;
fieldSetFlags()[1] = true;
return this;
}
/**
* Checks whether the 'lastExecuteTimestamp' field has been set.
* @return True if the 'lastExecuteTimestamp' field has been set, false otherwise.
*/
public boolean hasLastExecuteTimestamp() {
return fieldSetFlags()[1];
}
/**
* Clears the value of the 'lastExecuteTimestamp' field.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder clearLastExecuteTimestamp() {
fieldSetFlags()[1] = false;
return this;
}
/**
* Gets the value of the 'lastFailedTimestamp' field.
* @return The value.
*/
public long getLastFailedTimestamp() {
return lastFailedTimestamp;
}
/**
* Sets the value of the 'lastFailedTimestamp' field.
* @param value The value of 'lastFailedTimestamp'.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder setLastFailedTimestamp(long value) {
validate(fields()[2], value);
this.lastFailedTimestamp = value;
fieldSetFlags()[2] = true;
return this;
}
/**
* Checks whether the 'lastFailedTimestamp' field has been set.
* @return True if the 'lastFailedTimestamp' field has been set, false otherwise.
*/
public boolean hasLastFailedTimestamp() {
return fieldSetFlags()[2];
}
/**
* Clears the value of the 'lastFailedTimestamp' field.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder clearLastFailedTimestamp() {
fieldSetFlags()[2] = false;
return this;
}
/**
* Gets the value of the 'serviceId' field.
* @return The value.
*/
public java.lang.String getServiceId() {
return serviceId;
}
/**
* Sets the value of the 'serviceId' field.
* @param value The value of 'serviceId'.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder setServiceId(java.lang.String value) {
validate(fields()[3], value);
this.serviceId = value;
fieldSetFlags()[3] = true;
return this;
}
/**
* Checks whether the 'serviceId' field has been set.
* @return True if the 'serviceId' field has been set, false otherwise.
*/
public boolean hasServiceId() {
return fieldSetFlags()[3];
}
/**
* Clears the value of the 'serviceId' field.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder clearServiceId() {
serviceId = null;
fieldSetFlags()[3] = false;
return this;
}
/**
* Gets the value of the 'tag' field.
* @return The value.
*/
public java.lang.String getTag() {
return tag;
}
/**
* Sets the value of the 'tag' field.
* @param value The value of 'tag'.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder setTag(java.lang.String value) {
validate(fields()[4], value);
this.tag = value;
fieldSetFlags()[4] = true;
return this;
}
/**
* Checks whether the 'tag' field has been set.
* @return True if the 'tag' field has been set, false otherwise.
*/
public boolean hasTag() {
return fieldSetFlags()[4];
}
/**
* Clears the value of the 'tag' field.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder clearTag() {
tag = null;
fieldSetFlags()[4] = false;
return this;
}
/**
* Gets the value of the 'protocol' field.
* @return The value.
*/
public java.lang.String getProtocol() {
return protocol;
}
/**
* Sets the value of the 'protocol' field.
* @param value The value of 'protocol'.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder setProtocol(java.lang.String value) {
validate(fields()[5], value);
this.protocol = value;
fieldSetFlags()[5] = true;
return this;
}
/**
* Checks whether the 'protocol' field has been set.
* @return True if the 'protocol' field has been set, false otherwise.
*/
public boolean hasProtocol() {
return fieldSetFlags()[5];
}
/**
* Clears the value of the 'protocol' field.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder clearProtocol() {
protocol = null;
fieldSetFlags()[5] = false;
return this;
}
/**
* Gets the value of the 'address' field.
* @return The value.
*/
public java.lang.String getAddress() {
return address;
}
/**
* Sets the value of the 'address' field.
* @param value The value of 'address'.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder setAddress(java.lang.String value) {
validate(fields()[6], value);
this.address = value;
fieldSetFlags()[6] = true;
return this;
}
/**
* Checks whether the 'address' field has been set.
* @return True if the 'address' field has been set, false otherwise.
*/
public boolean hasAddress() {
return fieldSetFlags()[6];
}
/**
* Clears the value of the 'address' field.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder clearAddress() {
address = null;
fieldSetFlags()[6] = false;
return this;
}
/**
* Gets the value of the 'port' field.
* @return The value.
*/
public int getPort() {
return port;
}
/**
* Sets the value of the 'port' field.
* @param value The value of 'port'.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder setPort(int value) {
validate(fields()[7], value);
this.port = value;
fieldSetFlags()[7] = true;
return this;
}
/**
* Checks whether the 'port' field has been set.
* @return True if the 'port' field has been set, false otherwise.
*/
public boolean hasPort() {
return fieldSetFlags()[7];
}
/**
* Clears the value of the 'port' field.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder clearPort() {
fieldSetFlags()[7] = false;
return this;
}
/**
* Gets the value of the 'tlsSkipVerify' field.
* @return The value.
*/
public boolean getTlsSkipVerify() {
return tlsSkipVerify;
}
/**
* Sets the value of the 'tlsSkipVerify' field.
* @param value The value of 'tlsSkipVerify'.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder setTlsSkipVerify(boolean value) {
validate(fields()[8], value);
this.tlsSkipVerify = value;
fieldSetFlags()[8] = true;
return this;
}
/**
* Checks whether the 'tlsSkipVerify' field has been set.
* @return True if the 'tlsSkipVerify' field has been set, false otherwise.
*/
public boolean hasTlsSkipVerify() {
return fieldSetFlags()[8];
}
/**
* Clears the value of the 'tlsSkipVerify' field.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder clearTlsSkipVerify() {
fieldSetFlags()[8] = false;
return this;
}
/**
* Gets the value of the 'interval' field.
* @return The value.
*/
public int getInterval() {
return interval;
}
/**
* Sets the value of the 'interval' field.
* @param value The value of 'interval'.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder setInterval(int value) {
validate(fields()[9], value);
this.interval = value;
fieldSetFlags()[9] = true;
return this;
}
/**
* Checks whether the 'interval' field has been set.
* @return True if the 'interval' field has been set, false otherwise.
*/
public boolean hasInterval() {
return fieldSetFlags()[9];
}
/**
* Clears the value of the 'interval' field.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder clearInterval() {
fieldSetFlags()[9] = false;
return this;
}
/**
* Gets the value of the 'id' field.
* @return The value.
*/
public java.lang.String getId() {
return id;
}
/**
* Sets the value of the 'id' field.
* @param value The value of 'id'.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder setId(java.lang.String value) {
validate(fields()[10], value);
this.id = value;
fieldSetFlags()[10] = true;
return this;
}
/**
* Checks whether the 'id' field has been set.
* @return True if the 'id' field has been set, false otherwise.
*/
public boolean hasId() {
return fieldSetFlags()[10];
}
/**
* Clears the value of the 'id' field.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder clearId() {
id = null;
fieldSetFlags()[10] = false;
return this;
}
/**
* Gets the value of the 'deregisterCriticalServiceAfter' field.
* @return The value.
*/
public int getDeregisterCriticalServiceAfter() {
return deregisterCriticalServiceAfter;
}
/**
* Sets the value of the 'deregisterCriticalServiceAfter' field.
* @param value The value of 'deregisterCriticalServiceAfter'.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder setDeregisterCriticalServiceAfter(int value) {
validate(fields()[11], value);
this.deregisterCriticalServiceAfter = value;
fieldSetFlags()[11] = true;
return this;
}
/**
* Checks whether the 'deregisterCriticalServiceAfter' field has been set.
* @return True if the 'deregisterCriticalServiceAfter' field has been set, false otherwise.
*/
public boolean hasDeregisterCriticalServiceAfter() {
return fieldSetFlags()[11];
}
/**
* Clears the value of the 'deregisterCriticalServiceAfter' field.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder clearDeregisterCriticalServiceAfter() {
fieldSetFlags()[11] = false;
return this;
}
/**
* Gets the value of the 'healthPath' field.
* @return The value.
*/
public java.lang.String getHealthPath() {
return healthPath;
}
/**
* Sets the value of the 'healthPath' field.
* @param value The value of 'healthPath'.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder setHealthPath(java.lang.String value) {
validate(fields()[12], value);
this.healthPath = value;
fieldSetFlags()[12] = true;
return this;
}
/**
* Checks whether the 'healthPath' field has been set.
* @return True if the 'healthPath' field has been set, false otherwise.
*/
public boolean hasHealthPath() {
return fieldSetFlags()[12];
}
/**
* Clears the value of the 'healthPath' field.
* @return This builder.
*/
public com.networknt.controller.HealthCheck.Builder clearHealthPath() {
healthPath = null;
fieldSetFlags()[12] = false;
return this;
}
@Override
@SuppressWarnings("unchecked")
public HealthCheck build() {
try {
HealthCheck record = new HealthCheck();
record.host = fieldSetFlags()[0] ? this.host : (java.lang.String) defaultValue(fields()[0]);
record.lastExecuteTimestamp = fieldSetFlags()[1] ? this.lastExecuteTimestamp : (java.lang.Long) defaultValue(fields()[1]);
record.lastFailedTimestamp = fieldSetFlags()[2] ? this.lastFailedTimestamp : (java.lang.Long) defaultValue(fields()[2]);
record.serviceId = fieldSetFlags()[3] ? this.serviceId : (java.lang.String) defaultValue(fields()[3]);
record.tag = fieldSetFlags()[4] ? this.tag : (java.lang.String) defaultValue(fields()[4]);
record.protocol = fieldSetFlags()[5] ? this.protocol : (java.lang.String) defaultValue(fields()[5]);
record.address = fieldSetFlags()[6] ? this.address : (java.lang.String) defaultValue(fields()[6]);
record.port = fieldSetFlags()[7] ? this.port : (java.lang.Integer) defaultValue(fields()[7]);
record.tlsSkipVerify = fieldSetFlags()[8] ? this.tlsSkipVerify : (java.lang.Boolean) defaultValue(fields()[8]);
record.interval = fieldSetFlags()[9] ? this.interval : (java.lang.Integer) defaultValue(fields()[9]);
record.id = fieldSetFlags()[10] ? this.id : (java.lang.String) defaultValue(fields()[10]);
record.deregisterCriticalServiceAfter = fieldSetFlags()[11] ? this.deregisterCriticalServiceAfter : (java.lang.Integer) defaultValue(fields()[11]);
record.healthPath = fieldSetFlags()[12] ? this.healthPath : (java.lang.String) defaultValue(fields()[12]);
return record;
} catch (org.apache.avro.AvroMissingFieldException e) {
throw e;
} catch (java.lang.Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
@SuppressWarnings("unchecked")
private static final org.apache.avro.io.DatumWriter
WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$);
@Override public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException {
WRITER$.write(this, SpecificData.getEncoder(out));
}
@SuppressWarnings("unchecked")
private static final org.apache.avro.io.DatumReader
READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$);
@Override public void readExternal(java.io.ObjectInput in)
throws java.io.IOException {
READER$.read(this, SpecificData.getDecoder(in));
}
@Override protected boolean hasCustomCoders() { return true; }
@Override public void customEncode(org.apache.avro.io.Encoder out)
throws java.io.IOException
{
out.writeString(this.host);
out.writeLong(this.lastExecuteTimestamp);
out.writeLong(this.lastFailedTimestamp);
out.writeString(this.serviceId);
if (this.tag == null) {
out.writeIndex(0);
out.writeNull();
} else {
out.writeIndex(1);
out.writeString(this.tag);
}
out.writeString(this.protocol);
out.writeString(this.address);
out.writeInt(this.port);
out.writeBoolean(this.tlsSkipVerify);
out.writeInt(this.interval);
out.writeString(this.id);
out.writeInt(this.deregisterCriticalServiceAfter);
out.writeString(this.healthPath);
}
@Override public void customDecode(org.apache.avro.io.ResolvingDecoder in)
throws java.io.IOException
{
org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff();
if (fieldOrder == null) {
this.host = in.readString();
this.lastExecuteTimestamp = in.readLong();
this.lastFailedTimestamp = in.readLong();
this.serviceId = in.readString();
if (in.readIndex() != 1) {
in.readNull();
this.tag = null;
} else {
this.tag = in.readString();
}
this.protocol = in.readString();
this.address = in.readString();
this.port = in.readInt();
this.tlsSkipVerify = in.readBoolean();
this.interval = in.readInt();
this.id = in.readString();
this.deregisterCriticalServiceAfter = in.readInt();
this.healthPath = in.readString();
} else {
for (int i = 0; i < 13; i++) {
switch (fieldOrder[i].pos()) {
case 0:
this.host = in.readString();
break;
case 1:
this.lastExecuteTimestamp = in.readLong();
break;
case 2:
this.lastFailedTimestamp = in.readLong();
break;
case 3:
this.serviceId = in.readString();
break;
case 4:
if (in.readIndex() != 1) {
in.readNull();
this.tag = null;
} else {
this.tag = in.readString();
}
break;
case 5:
this.protocol = in.readString();
break;
case 6:
this.address = in.readString();
break;
case 7:
this.port = in.readInt();
break;
case 8:
this.tlsSkipVerify = in.readBoolean();
break;
case 9:
this.interval = in.readInt();
break;
case 10:
this.id = in.readString();
break;
case 11:
this.deregisterCriticalServiceAfter = in.readInt();
break;
case 12:
this.healthPath = in.readString();
break;
default:
throw new java.io.IOException("Corrupt ResolvingDecoder.");
}
}
}
}
}