/** * Creates a Builder by copying an existing HttpRequestResponseRecord instance * @param other The existing instance to copy. */ private Builder(org.apache.gobblin.http.HttpRequestResponseRecord other) { super(SCHEMA$); if (isValidValue(fields()[0], other.requestUrl)) { this.requestUrl = data().deepCopy(fields()[0].schema(), other.requestUrl); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.method)) { this.method = data().deepCopy(fields()[1].schema(), other.method); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.contentType)) { this.contentType = data().deepCopy(fields()[2].schema(), other.contentType); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.statusCode)) { this.statusCode = data().deepCopy(fields()[3].schema(), other.statusCode); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.body)) { this.body = data().deepCopy(fields()[4].schema(), other.body); fieldSetFlags()[4] = true; } }
/** * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ private Builder(org.apache.gobblin.http.HttpRequestResponseRecord.Builder other) { super(other); if (isValidValue(fields()[0], other.requestUrl)) { this.requestUrl = data().deepCopy(fields()[0].schema(), other.requestUrl); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.method)) { this.method = data().deepCopy(fields()[1].schema(), other.method); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.contentType)) { this.contentType = data().deepCopy(fields()[2].schema(), other.contentType); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.statusCode)) { this.statusCode = data().deepCopy(fields()[3].schema(), other.statusCode); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.body)) { this.body = data().deepCopy(fields()[4].schema(), other.body); fieldSetFlags()[4] = true; } }
@Override public HttpRequestResponseRecord build() { try { HttpRequestResponseRecord record = new HttpRequestResponseRecord(); record.requestUrl = fieldSetFlags()[0] ? this.requestUrl : (java.lang.String) defaultValue(fields()[0]); record.method = fieldSetFlags()[1] ? this.method : (java.lang.String) defaultValue(fields()[1]); record.contentType = fieldSetFlags()[2] ? this.contentType : (java.lang.String) defaultValue(fields()[2]); record.statusCode = fieldSetFlags()[3] ? this.statusCode : (java.lang.Integer) defaultValue(fields()[3]); record.body = fieldSetFlags()[4] ? this.body : (java.nio.ByteBuffer) defaultValue(fields()[4]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** * Clears the value of the 'body' field. * @return This builder. */ public org.apache.gobblin.http.HttpRequestResponseRecord.Builder clearBody() { body = null; fieldSetFlags()[4] = false; return this; }
/** * Checks whether the 'body' field has been set. * @return True if the 'body' field has been set, false otherwise. */ public boolean hasBody() { return fieldSetFlags()[4]; }
/** * Checks whether the 'body' field has been set. * @return True if the 'body' field has been set, false otherwise. */ public boolean hasBody() { return fieldSetFlags()[4]; }
/** * Sets the value of the 'body' field. * @param value The value of 'body'. * @return This builder. */ public org.apache.gobblin.http.HttpRequestResponseRecord.Builder setBody(java.nio.ByteBuffer value) { validate(fields()[4], value); this.body = value; fieldSetFlags()[4] = true; return this; }
/** * Checks whether the 'contentType' field has been set. * @return True if the 'contentType' field has been set, false otherwise. */ public boolean hasContentType() { return fieldSetFlags()[2]; }
/** * Clears the value of the 'method' field. * @return This builder. */ public org.apache.gobblin.http.HttpRequestResponseRecord.Builder clearMethod() { method = null; fieldSetFlags()[1] = false; return this; }
/** * Sets the value of the 'method' field. * @param value The value of 'method'. * @return This builder. */ public org.apache.gobblin.http.HttpRequestResponseRecord.Builder setMethod(java.lang.String value) { validate(fields()[1], value); this.method = value; fieldSetFlags()[1] = true; return this; }
/** * Clears the value of the 'requestUrl' field. * @return This builder. */ public org.apache.gobblin.http.HttpRequestResponseRecord.Builder clearRequestUrl() { requestUrl = null; fieldSetFlags()[0] = false; return this; }
/** * Clears the value of the 'statusCode' field. * @return This builder. */ public org.apache.gobblin.http.HttpRequestResponseRecord.Builder clearStatusCode() { fieldSetFlags()[3] = false; return this; }
/** * Checks whether the 'statusCode' field has been set. * @return True if the 'statusCode' field has been set, false otherwise. */ public boolean hasStatusCode() { return fieldSetFlags()[3]; }
/** * Sets the value of the 'contentType' field. * @param value The value of 'contentType'. * @return This builder. */ public org.apache.gobblin.http.HttpRequestResponseRecord.Builder setContentType(java.lang.String value) { validate(fields()[2], value); this.contentType = value; fieldSetFlags()[2] = true; return this; }
/** * Sets the value of the 'requestUrl' field. * @param value The value of 'requestUrl'. * @return This builder. */ public org.apache.gobblin.http.HttpRequestResponseRecord.Builder setRequestUrl(java.lang.String value) { validate(fields()[0], value); this.requestUrl = value; fieldSetFlags()[0] = true; return this; }
/** * Clears the value of the 'body' field. * @return This builder. */ public org.apache.gobblin.http.HttpRequestResponseRecord.Builder clearBody() { body = null; fieldSetFlags()[4] = false; return this; }
/** * Sets the value of the 'statusCode' field. * @param value The value of 'statusCode'. * @return This builder. */ public org.apache.gobblin.http.HttpRequestResponseRecord.Builder setStatusCode(int value) { validate(fields()[3], value); this.statusCode = value; fieldSetFlags()[3] = true; return this; }
/** * Clears the value of the 'contentType' field. * @return This builder. */ public org.apache.gobblin.http.HttpRequestResponseRecord.Builder clearContentType() { contentType = null; fieldSetFlags()[2] = false; return this; }
/** * Checks whether the 'method' field has been set. * @return True if the 'method' field has been set, false otherwise. */ public boolean hasMethod() { return fieldSetFlags()[1]; }
/** * Checks whether the 'requestUrl' field has been set. * @return True if the 'requestUrl' field has been set, false otherwise. */ public boolean hasRequestUrl() { return fieldSetFlags()[0]; }