/** * Creates a Builder by copying an existing HandshakeResponse instance * @param other The existing instance to copy. */ private Builder(org.apache.avro.ipc.HandshakeResponse other) { super(SCHEMA$); if (isValidValue(fields()[0], other.match)) { this.match = data().deepCopy(fields()[0].schema(), other.match); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.serverProtocol)) { this.serverProtocol = data().deepCopy(fields()[1].schema(), other.serverProtocol); 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.HandshakeResponse.Builder other) { super(other); if (isValidValue(fields()[0], other.match)) { this.match = data().deepCopy(fields()[0].schema(), other.match); fieldSetFlags()[0] = other.fieldSetFlags()[0]; } if (isValidValue(fields()[1], other.serverProtocol)) { this.serverProtocol = data().deepCopy(fields()[1].schema(), other.serverProtocol); 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 HandshakeResponse build() { try { HandshakeResponse record = new HandshakeResponse(); record.match = fieldSetFlags()[0] ? this.match : (org.apache.avro.ipc.HandshakeMatch) defaultValue(fields()[0]); record.serverProtocol = fieldSetFlags()[1] ? this.serverProtocol : (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); } } }
/** * Clears the value of the 'serverHash' field. * @return This builder. */ public org.apache.avro.ipc.HandshakeResponse.Builder clearServerHash() { serverHash = null; fieldSetFlags()[2] = false; return this; }
/** * Sets the value of the 'serverHash' field. * @param value The value of 'serverHash'. * @return This builder. */ public org.apache.avro.ipc.HandshakeResponse.Builder setServerHash(org.apache.avro.ipc.MD5 value) { validate(fields()[2], value); this.serverHash = value; fieldSetFlags()[2] = true; return this; }
/** * Sets the value of the 'serverProtocol' field. * @param value The value of 'serverProtocol'. * @return This builder. */ public org.apache.avro.ipc.HandshakeResponse.Builder setServerProtocol(java.lang.String value) { validate(fields()[1], value); this.serverProtocol = value; fieldSetFlags()[1] = true; return this; }
/** * Clears the value of the 'serverProtocol' field. * @return This builder. */ public org.apache.avro.ipc.HandshakeResponse.Builder clearServerProtocol() { serverProtocol = null; fieldSetFlags()[1] = false; return this; }
/** * Checks whether the 'match' field has been set. * @return True if the 'match' field has been set, false otherwise. */ public boolean hasMatch() { return fieldSetFlags()[0]; }
/** * 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]; }
/** * Sets the value of the 'meta' field. * @param value The value of 'meta'. * @return This builder. */ public org.apache.avro.ipc.HandshakeResponse.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 'serverHash' field. * @return This builder. */ public org.apache.avro.ipc.HandshakeResponse.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]; }
/** * Clears the value of the 'serverProtocol' field. * @return This builder. */ public org.apache.avro.ipc.HandshakeResponse.Builder clearServerProtocol() { serverProtocol = null; fieldSetFlags()[1] = false; return this; }
/** * Checks whether the 'serverProtocol' field has been set. * @return True if the 'serverProtocol' field has been set, false otherwise. */ public boolean hasServerProtocol() { return fieldSetFlags()[1]; }
/** * Checks whether the 'match' field has been set. * @return True if the 'match' field has been set, false otherwise. */ public boolean hasMatch() { return fieldSetFlags()[0]; }
/** * Sets the value of the 'match' field. * @param value The value of 'match'. * @return This builder. */ public org.apache.avro.ipc.HandshakeResponse.Builder setMatch(org.apache.avro.ipc.HandshakeMatch value) { validate(fields()[0], value); this.match = value; fieldSetFlags()[0] = true; return this; }
/** * Sets the value of the 'serverProtocol' field. * @param value The value of 'serverProtocol'. * @return This builder. */ public org.apache.avro.ipc.HandshakeResponse.Builder setServerProtocol(java.lang.String value) { validate(fields()[1], value); this.serverProtocol = value; fieldSetFlags()[1] = true; return this; }
/** * Clears the value of the 'meta' field. * @return This builder. */ public org.apache.avro.ipc.HandshakeResponse.Builder clearMeta() { meta = null; fieldSetFlags()[3] = false; return this; }
/** * Clears the value of the 'match' field. * @return This builder. */ public org.apache.avro.ipc.HandshakeResponse.Builder clearMatch() { match = null; fieldSetFlags()[0] = false; return this; }
/** * Sets the value of the 'serverHash' field. * @param value The value of 'serverHash'. * @return This builder. */ public org.apache.avro.ipc.HandshakeResponse.Builder setServerHash(org.apache.avro.ipc.MD5 value) { validate(fields()[2], value); this.serverHash = value; fieldSetFlags()[2] = true; return this; }