
com.homeaway.digitalplatform.streamregistry.ClusterKey Maven / Gradle / Ivy
The newest version!
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package com.homeaway.digitalplatform.streamregistry;
import org.apache.avro.specific.SpecificData;
import org.apache.avro.message.BinaryMessageEncoder;
import org.apache.avro.message.BinaryMessageDecoder;
import org.apache.avro.message.SchemaStore;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class ClusterKey extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
private static final long serialVersionUID = 2632176878076727011L;
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ClusterKey\",\"namespace\":\"com.homeaway.digitalplatform.streamregistry\",\"fields\":[{\"name\":\"vpc\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"* vpc name\"},{\"name\":\"env\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"* environment Ex: dev, test, stage, prod\"},{\"name\":\"hint\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"* hint for the cluster ex: primary, other, etc..\"},{\"name\":\"type\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"* type of cluster ex: producer, consumer\",\"default\":null}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
private static SpecificData MODEL$ = new SpecificData();
private static final BinaryMessageEncoder ENCODER =
new BinaryMessageEncoder(MODEL$, SCHEMA$);
private static final BinaryMessageDecoder DECODER =
new BinaryMessageDecoder(MODEL$, SCHEMA$);
/**
* Return the BinaryMessageDecoder instance 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
*/
public static BinaryMessageDecoder createDecoder(SchemaStore resolver) {
return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver);
}
/** Serializes this ClusterKey to a ByteBuffer. */
public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException {
return ENCODER.encode(this);
}
/** Deserializes a ClusterKey from a ByteBuffer. */
public static ClusterKey fromByteBuffer(
java.nio.ByteBuffer b) throws java.io.IOException {
return DECODER.decode(b);
}
/** * vpc name */
@Deprecated public java.lang.String vpc;
/** * environment Ex: dev, test, stage, prod */
@Deprecated public java.lang.String env;
/** * hint for the cluster ex: primary, other, etc.. */
@Deprecated public java.lang.String hint;
/** * type of cluster ex: producer, consumer */
@Deprecated public java.lang.String type;
/**
* 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 ClusterKey() {}
/**
* All-args constructor.
* @param vpc * vpc name
* @param env * environment Ex: dev, test, stage, prod
* @param hint * hint for the cluster ex: primary, other, etc..
* @param type * type of cluster ex: producer, consumer
*/
public ClusterKey(java.lang.String vpc, java.lang.String env, java.lang.String hint, java.lang.String type) {
this.vpc = vpc;
this.env = env;
this.hint = hint;
this.type = type;
}
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 vpc;
case 1: return env;
case 2: return hint;
case 3: return type;
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: vpc = (java.lang.String)value$; break;
case 1: env = (java.lang.String)value$; break;
case 2: hint = (java.lang.String)value$; break;
case 3: type = (java.lang.String)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'vpc' field.
* @return * vpc name
*/
public java.lang.String getVpc() {
return vpc;
}
/**
* Sets the value of the 'vpc' field.
* * vpc name
* @param value the value to set.
*/
public void setVpc(java.lang.String value) {
this.vpc = value;
}
/**
* Gets the value of the 'env' field.
* @return * environment Ex: dev, test, stage, prod
*/
public java.lang.String getEnv() {
return env;
}
/**
* Sets the value of the 'env' field.
* * environment Ex: dev, test, stage, prod
* @param value the value to set.
*/
public void setEnv(java.lang.String value) {
this.env = value;
}
/**
* Gets the value of the 'hint' field.
* @return * hint for the cluster ex: primary, other, etc..
*/
public java.lang.String getHint() {
return hint;
}
/**
* Sets the value of the 'hint' field.
* * hint for the cluster ex: primary, other, etc..
* @param value the value to set.
*/
public void setHint(java.lang.String value) {
this.hint = value;
}
/**
* Gets the value of the 'type' field.
* @return * type of cluster ex: producer, consumer
*/
public java.lang.String getType() {
return type;
}
/**
* Sets the value of the 'type' field.
* * type of cluster ex: producer, consumer
* @param value the value to set.
*/
public void setType(java.lang.String value) {
this.type = value;
}
/**
* Creates a new ClusterKey RecordBuilder.
* @return A new ClusterKey RecordBuilder
*/
public static com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder newBuilder() {
return new com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder();
}
/**
* Creates a new ClusterKey RecordBuilder by copying an existing Builder.
* @param other The existing builder to copy.
* @return A new ClusterKey RecordBuilder
*/
public static com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder newBuilder(com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder other) {
return new com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder(other);
}
/**
* Creates a new ClusterKey RecordBuilder by copying an existing ClusterKey instance.
* @param other The existing instance to copy.
* @return A new ClusterKey RecordBuilder
*/
public static com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder newBuilder(com.homeaway.digitalplatform.streamregistry.ClusterKey other) {
return new com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder(other);
}
/**
* RecordBuilder for ClusterKey instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
/** * vpc name */
private java.lang.String vpc;
/** * environment Ex: dev, test, stage, prod */
private java.lang.String env;
/** * hint for the cluster ex: primary, other, etc.. */
private java.lang.String hint;
/** * type of cluster ex: producer, consumer */
private java.lang.String type;
/** Creates a new Builder */
private Builder() {
super(SCHEMA$);
}
/**
* Creates a Builder by copying an existing Builder.
* @param other The existing Builder to copy.
*/
private Builder(com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder other) {
super(other);
if (isValidValue(fields()[0], other.vpc)) {
this.vpc = data().deepCopy(fields()[0].schema(), other.vpc);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.env)) {
this.env = data().deepCopy(fields()[1].schema(), other.env);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.hint)) {
this.hint = data().deepCopy(fields()[2].schema(), other.hint);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.type)) {
this.type = data().deepCopy(fields()[3].schema(), other.type);
fieldSetFlags()[3] = true;
}
}
/**
* Creates a Builder by copying an existing ClusterKey instance
* @param other The existing instance to copy.
*/
private Builder(com.homeaway.digitalplatform.streamregistry.ClusterKey other) {
super(SCHEMA$);
if (isValidValue(fields()[0], other.vpc)) {
this.vpc = data().deepCopy(fields()[0].schema(), other.vpc);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.env)) {
this.env = data().deepCopy(fields()[1].schema(), other.env);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.hint)) {
this.hint = data().deepCopy(fields()[2].schema(), other.hint);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.type)) {
this.type = data().deepCopy(fields()[3].schema(), other.type);
fieldSetFlags()[3] = true;
}
}
/**
* Gets the value of the 'vpc' field.
* * vpc name
* @return The value.
*/
public java.lang.String getVpc() {
return vpc;
}
/**
* Sets the value of the 'vpc' field.
* * vpc name
* @param value The value of 'vpc'.
* @return This builder.
*/
public com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder setVpc(java.lang.String value) {
validate(fields()[0], value);
this.vpc = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'vpc' field has been set.
* * vpc name
* @return True if the 'vpc' field has been set, false otherwise.
*/
public boolean hasVpc() {
return fieldSetFlags()[0];
}
/**
* Clears the value of the 'vpc' field.
* * vpc name
* @return This builder.
*/
public com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder clearVpc() {
vpc = null;
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'env' field.
* * environment Ex: dev, test, stage, prod
* @return The value.
*/
public java.lang.String getEnv() {
return env;
}
/**
* Sets the value of the 'env' field.
* * environment Ex: dev, test, stage, prod
* @param value The value of 'env'.
* @return This builder.
*/
public com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder setEnv(java.lang.String value) {
validate(fields()[1], value);
this.env = value;
fieldSetFlags()[1] = true;
return this;
}
/**
* Checks whether the 'env' field has been set.
* * environment Ex: dev, test, stage, prod
* @return True if the 'env' field has been set, false otherwise.
*/
public boolean hasEnv() {
return fieldSetFlags()[1];
}
/**
* Clears the value of the 'env' field.
* * environment Ex: dev, test, stage, prod
* @return This builder.
*/
public com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder clearEnv() {
env = null;
fieldSetFlags()[1] = false;
return this;
}
/**
* Gets the value of the 'hint' field.
* * hint for the cluster ex: primary, other, etc..
* @return The value.
*/
public java.lang.String getHint() {
return hint;
}
/**
* Sets the value of the 'hint' field.
* * hint for the cluster ex: primary, other, etc..
* @param value The value of 'hint'.
* @return This builder.
*/
public com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder setHint(java.lang.String value) {
validate(fields()[2], value);
this.hint = value;
fieldSetFlags()[2] = true;
return this;
}
/**
* Checks whether the 'hint' field has been set.
* * hint for the cluster ex: primary, other, etc..
* @return True if the 'hint' field has been set, false otherwise.
*/
public boolean hasHint() {
return fieldSetFlags()[2];
}
/**
* Clears the value of the 'hint' field.
* * hint for the cluster ex: primary, other, etc..
* @return This builder.
*/
public com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder clearHint() {
hint = null;
fieldSetFlags()[2] = false;
return this;
}
/**
* Gets the value of the 'type' field.
* * type of cluster ex: producer, consumer
* @return The value.
*/
public java.lang.String getType() {
return type;
}
/**
* Sets the value of the 'type' field.
* * type of cluster ex: producer, consumer
* @param value The value of 'type'.
* @return This builder.
*/
public com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder setType(java.lang.String value) {
validate(fields()[3], value);
this.type = value;
fieldSetFlags()[3] = true;
return this;
}
/**
* Checks whether the 'type' field has been set.
* * type of cluster ex: producer, consumer
* @return True if the 'type' field has been set, false otherwise.
*/
public boolean hasType() {
return fieldSetFlags()[3];
}
/**
* Clears the value of the 'type' field.
* * type of cluster ex: producer, consumer
* @return This builder.
*/
public com.homeaway.digitalplatform.streamregistry.ClusterKey.Builder clearType() {
type = null;
fieldSetFlags()[3] = false;
return this;
}
@Override
@SuppressWarnings("unchecked")
public ClusterKey build() {
try {
ClusterKey record = new ClusterKey();
record.vpc = fieldSetFlags()[0] ? this.vpc : (java.lang.String) defaultValue(fields()[0]);
record.env = fieldSetFlags()[1] ? this.env : (java.lang.String) defaultValue(fields()[1]);
record.hint = fieldSetFlags()[2] ? this.hint : (java.lang.String) defaultValue(fields()[2]);
record.type = fieldSetFlags()[3] ? this.type : (java.lang.String) defaultValue(fields()[3]);
return record;
} 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));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy