/** * 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; } }
/** * 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] = other.fieldSetFlags()[0]; } if (isValidValue(fields()[1], other.clientProtocol)) { this.clientProtocol = data().deepCopy(fields()[1].schema(), other.clientProtocol); fieldSetFlags()[1] = other.fieldSetFlags()[1]; } if (isValidValue(fields()[2], other.serverHash)) { this.serverHash = data().deepCopy(fields()[2].schema(), other.serverHash); fieldSetFlags()[2] = other.fieldSetFlags()[2]; } if (isValidValue(fields()[3], other.meta)) { this.meta = data().deepCopy(fields()[3].schema(), other.meta); fieldSetFlags()[3] = other.fieldSetFlags()[3]; } }
@Override @SuppressWarnings("unchecked") 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<java.lang.String,java.nio.ByteBuffer>) defaultValue(fields()[3]); return record; } catch (org.apache.avro.AvroMissingFieldException e) { throw e; } catch (java.lang.Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** * 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<java.lang.String,java.nio.ByteBuffer> value) { validate(fields()[3], value); this.meta = value; fieldSetFlags()[3] = true; return this; }
/** * 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; }
/** * 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 'serverHash' field. * @return This builder. */ public org.apache.avro.ipc.HandshakeRequest.Builder clearServerHash() { serverHash = null; fieldSetFlags()[2] = false; 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]; }
/** * 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 'meta' field. * @return This builder. */ public org.apache.avro.ipc.HandshakeRequest.Builder clearMeta() { meta = null; fieldSetFlags()[3] = false; return this; }
/** * 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<java.lang.String,java.nio.ByteBuffer> value) { validate(fields()[3], value); this.meta = value; fieldSetFlags()[3] = true; return this; }
/** * 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; }
/** * 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; }
/** * 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 'clientHash' field has been set. * @return True if the 'clientHash' field has been set, false otherwise. */ public boolean hasClientHash() { return fieldSetFlags()[0]; }
/** * 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 '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 'clientProtocol' field. * @return This builder. */ public org.apache.avro.ipc.HandshakeRequest.Builder clearClientProtocol() { clientProtocol = null; fieldSetFlags()[1] = false; return this; }
/** * 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; }
/** * 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]; }