org.apache.avro.ipc.HandshakeRequest Maven / Gradle / Ivy
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.apache.avro.ipc;
import org.apache.avro.specific.SpecificData;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class HandshakeRequest extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
private static final long serialVersionUID = 6293635732927376057L;
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"HandshakeRequest\",\"namespace\":\"org.apache.avro.ipc\",\"fields\":[{\"name\":\"clientHash\",\"type\":{\"type\":\"fixed\",\"name\":\"MD5\",\"size\":16}},{\"name\":\"clientProtocol\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"serverHash\",\"type\":\"MD5\"},{\"name\":\"meta\",\"type\":[\"null\",{\"type\":\"map\",\"values\":\"bytes\",\"avro.java.string\":\"String\"}]}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
@Deprecated public org.apache.avro.ipc.MD5 clientHash;
@Deprecated public java.lang.String clientProtocol;
@Deprecated public org.apache.avro.ipc.MD5 serverHash;
@Deprecated public java.util.Map meta;
/**
* 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 HandshakeRequest() {}
/**
* All-args constructor.
* @param clientHash The new value for clientHash
* @param clientProtocol The new value for clientProtocol
* @param serverHash The new value for serverHash
* @param meta The new value for meta
*/
public HandshakeRequest(org.apache.avro.ipc.MD5 clientHash, java.lang.String clientProtocol, org.apache.avro.ipc.MD5 serverHash, java.util.Map meta) {
this.clientHash = clientHash;
this.clientProtocol = clientProtocol;
this.serverHash = serverHash;
this.meta = meta;
}
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 clientHash;
case 1: return clientProtocol;
case 2: return serverHash;
case 3: return meta;
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: clientHash = (org.apache.avro.ipc.MD5)value$; break;
case 1: clientProtocol = (java.lang.String)value$; break;
case 2: serverHash = (org.apache.avro.ipc.MD5)value$; break;
case 3: meta = (java.util.Map)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'clientHash' field.
* @return The value of the 'clientHash' field.
*/
public org.apache.avro.ipc.MD5 getClientHash() {
return clientHash;
}
/**
* Sets the value of the 'clientHash' field.
* @param value the value to set.
*/
public void setClientHash(org.apache.avro.ipc.MD5 value) {
this.clientHash = value;
}
/**
* Gets the value of the 'clientProtocol' field.
* @return The value of the 'clientProtocol' field.
*/
public java.lang.String getClientProtocol() {
return clientProtocol;
}
/**
* Sets the value of the 'clientProtocol' field.
* @param value the value to set.
*/
public void setClientProtocol(java.lang.String value) {
this.clientProtocol = value;
}
/**
* Gets the value of the 'serverHash' field.
* @return The value of the 'serverHash' field.
*/
public org.apache.avro.ipc.MD5 getServerHash() {
return serverHash;
}
/**
* Sets the value of the 'serverHash' field.
* @param value the value to set.
*/
public void setServerHash(org.apache.avro.ipc.MD5 value) {
this.serverHash = value;
}
/**
* Gets the value of the 'meta' field.
* @return The value of the 'meta' field.
*/
public java.util.Map getMeta() {
return meta;
}
/**
* Sets the value of the 'meta' field.
* @param value the value to set.
*/
public void setMeta(java.util.Map value) {
this.meta = value;
}
/**
* Creates a new HandshakeRequest RecordBuilder.
* @return A new HandshakeRequest RecordBuilder
*/
public static org.apache.avro.ipc.HandshakeRequest.Builder newBuilder() {
return new org.apache.avro.ipc.HandshakeRequest.Builder();
}
/**
* Creates a new HandshakeRequest RecordBuilder by copying an existing Builder.
* @param other The existing builder to copy.
* @return A new HandshakeRequest RecordBuilder
*/
public static org.apache.avro.ipc.HandshakeRequest.Builder newBuilder(org.apache.avro.ipc.HandshakeRequest.Builder other) {
return new org.apache.avro.ipc.HandshakeRequest.Builder(other);
}
/**
* Creates a new HandshakeRequest RecordBuilder by copying an existing HandshakeRequest instance.
* @param other The existing instance to copy.
* @return A new HandshakeRequest RecordBuilder
*/
public static org.apache.avro.ipc.HandshakeRequest.Builder newBuilder(org.apache.avro.ipc.HandshakeRequest other) {
return new org.apache.avro.ipc.HandshakeRequest.Builder(other);
}
/**
* RecordBuilder for HandshakeRequest instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private org.apache.avro.ipc.MD5 clientHash;
private java.lang.String clientProtocol;
private org.apache.avro.ipc.MD5 serverHash;
private java.util.Map meta;
/** 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(org.apache.avro.ipc.HandshakeRequest.Builder other) {
super(other);
if (isValidValue(fields()[0], other.clientHash)) {
this.clientHash = data().deepCopy(fields()[0].schema(), other.clientHash);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.clientProtocol)) {
this.clientProtocol = data().deepCopy(fields()[1].schema(), other.clientProtocol);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.serverHash)) {
this.serverHash = data().deepCopy(fields()[2].schema(), other.serverHash);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.meta)) {
this.meta = data().deepCopy(fields()[3].schema(), other.meta);
fieldSetFlags()[3] = true;
}
}
/**
* Creates a Builder by copying an existing HandshakeRequest instance
* @param other The existing instance to copy.
*/
private Builder(org.apache.avro.ipc.HandshakeRequest other) {
super(SCHEMA$);
if (isValidValue(fields()[0], other.clientHash)) {
this.clientHash = data().deepCopy(fields()[0].schema(), other.clientHash);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.clientProtocol)) {
this.clientProtocol = data().deepCopy(fields()[1].schema(), other.clientProtocol);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.serverHash)) {
this.serverHash = data().deepCopy(fields()[2].schema(), other.serverHash);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.meta)) {
this.meta = data().deepCopy(fields()[3].schema(), other.meta);
fieldSetFlags()[3] = true;
}
}
/**
* Gets the value of the 'clientHash' field.
* @return The value.
*/
public org.apache.avro.ipc.MD5 getClientHash() {
return clientHash;
}
/**
* Sets the value of the 'clientHash' field.
* @param value The value of 'clientHash'.
* @return This builder.
*/
public org.apache.avro.ipc.HandshakeRequest.Builder setClientHash(org.apache.avro.ipc.MD5 value) {
validate(fields()[0], value);
this.clientHash = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'clientHash' field has been set.
* @return True if the 'clientHash' field has been set, false otherwise.
*/
public boolean hasClientHash() {
return fieldSetFlags()[0];
}
/**
* Clears the value of the 'clientHash' field.
* @return This builder.
*/
public org.apache.avro.ipc.HandshakeRequest.Builder clearClientHash() {
clientHash = null;
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'clientProtocol' field.
* @return The value.
*/
public java.lang.String getClientProtocol() {
return clientProtocol;
}
/**
* Sets the value of the 'clientProtocol' field.
* @param value The value of 'clientProtocol'.
* @return This builder.
*/
public org.apache.avro.ipc.HandshakeRequest.Builder setClientProtocol(java.lang.String value) {
validate(fields()[1], value);
this.clientProtocol = value;
fieldSetFlags()[1] = true;
return this;
}
/**
* Checks whether the 'clientProtocol' field has been set.
* @return True if the 'clientProtocol' field has been set, false otherwise.
*/
public boolean hasClientProtocol() {
return fieldSetFlags()[1];
}
/**
* Clears the value of the 'clientProtocol' field.
* @return This builder.
*/
public org.apache.avro.ipc.HandshakeRequest.Builder clearClientProtocol() {
clientProtocol = null;
fieldSetFlags()[1] = false;
return this;
}
/**
* Gets the value of the 'serverHash' field.
* @return The value.
*/
public org.apache.avro.ipc.MD5 getServerHash() {
return serverHash;
}
/**
* Sets the value of the 'serverHash' field.
* @param value The value of 'serverHash'.
* @return This builder.
*/
public org.apache.avro.ipc.HandshakeRequest.Builder setServerHash(org.apache.avro.ipc.MD5 value) {
validate(fields()[2], value);
this.serverHash = value;
fieldSetFlags()[2] = true;
return this;
}
/**
* Checks whether the 'serverHash' field has been set.
* @return True if the 'serverHash' field has been set, false otherwise.
*/
public boolean hasServerHash() {
return fieldSetFlags()[2];
}
/**
* Clears the value of the 'serverHash' field.
* @return This builder.
*/
public org.apache.avro.ipc.HandshakeRequest.Builder clearServerHash() {
serverHash = null;
fieldSetFlags()[2] = false;
return this;
}
/**
* Gets the value of the 'meta' field.
* @return The value.
*/
public java.util.Map getMeta() {
return meta;
}
/**
* Sets the value of the 'meta' field.
* @param value The value of 'meta'.
* @return This builder.
*/
public org.apache.avro.ipc.HandshakeRequest.Builder setMeta(java.util.Map value) {
validate(fields()[3], value);
this.meta = value;
fieldSetFlags()[3] = true;
return this;
}
/**
* Checks whether the 'meta' field has been set.
* @return True if the 'meta' field has been set, false otherwise.
*/
public boolean hasMeta() {
return fieldSetFlags()[3];
}
/**
* Clears the value of the 'meta' field.
* @return This builder.
*/
public org.apache.avro.ipc.HandshakeRequest.Builder clearMeta() {
meta = null;
fieldSetFlags()[3] = false;
return this;
}
@Override
public HandshakeRequest build() {
try {
HandshakeRequest record = new HandshakeRequest();
record.clientHash = fieldSetFlags()[0] ? this.clientHash : (org.apache.avro.ipc.MD5) defaultValue(fields()[0]);
record.clientProtocol = fieldSetFlags()[1] ? this.clientProtocol : (java.lang.String) defaultValue(fields()[1]);
record.serverHash = fieldSetFlags()[2] ? this.serverHash : (org.apache.avro.ipc.MD5) defaultValue(fields()[2]);
record.meta = fieldSetFlags()[3] ? this.meta : (java.util.Map) defaultValue(fields()[3]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
private static final org.apache.avro.io.DatumWriter
WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);
@Override public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException {
WRITER$.write(this, SpecificData.getEncoder(out));
}
private static final org.apache.avro.io.DatumReader
READER$ = new org.apache.avro.specific.SpecificDatumReader(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