/** * Creates a Builder by copying an existing MetricReport instance * @param other The existing instance to copy. */ private Builder(org.apache.gobblin.metrics.MetricReport other) { super(SCHEMA$); if (isValidValue(fields()[0], other.tags)) { this.tags = data().deepCopy(fields()[0].schema(), other.tags); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.timestamp)) { this.timestamp = data().deepCopy(fields()[1].schema(), other.timestamp); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.metrics)) { this.metrics = data().deepCopy(fields()[2].schema(), other.metrics); fieldSetFlags()[2] = true; } }
/** * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ private Builder(org.apache.gobblin.metrics.MetricReport.Builder other) { super(other); if (isValidValue(fields()[0], other.tags)) { this.tags = data().deepCopy(fields()[0].schema(), other.tags); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.timestamp)) { this.timestamp = data().deepCopy(fields()[1].schema(), other.timestamp); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.metrics)) { this.metrics = data().deepCopy(fields()[2].schema(), other.metrics); fieldSetFlags()[2] = true; } }
@Override public MetricReport build() { try { MetricReport record = new MetricReport(); record.tags = fieldSetFlags()[0] ? this.tags : (java.util.Map<java.lang.String,java.lang.String>) defaultValue(fields()[0]); record.timestamp = fieldSetFlags()[1] ? this.timestamp : (java.lang.Long) defaultValue(fields()[1]); record.metrics = fieldSetFlags()[2] ? this.metrics : (java.util.List<org.apache.gobblin.metrics.Metric>) defaultValue(fields()[2]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** * Checks whether the 'metrics' field has been set. * Array of metrics in this report. * @return True if the 'metrics' field has been set, false otherwise. */ public boolean hasMetrics() { return fieldSetFlags()[2]; }
/** * Sets the value of the 'metrics' field. * Array of metrics in this report. * @param value The value of 'metrics'. * @return This builder. */ public org.apache.gobblin.metrics.MetricReport.Builder setMetrics(java.util.List<org.apache.gobblin.metrics.Metric> value) { validate(fields()[2], value); this.metrics = value; fieldSetFlags()[2] = true; return this; }
/** * Clears the value of the 'tags' field. * Tags associated with the metrics. * @return This builder. */ public org.apache.gobblin.metrics.MetricReport.Builder clearTags() { tags = null; fieldSetFlags()[0] = false; return this; }
/** * Clears the value of the 'timestamp' field. * Time at which metrics were reported. * @return This builder. */ public org.apache.gobblin.metrics.MetricReport.Builder clearTimestamp() { fieldSetFlags()[1] = false; return this; }
/** * Checks whether the 'timestamp' field has been set. * Time at which metrics were reported. * @return True if the 'timestamp' field has been set, false otherwise. */ public boolean hasTimestamp() { return fieldSetFlags()[1]; }
/** * Sets the value of the 'timestamp' field. * Time at which metrics were reported. * @param value The value of 'timestamp'. * @return This builder. */ public org.apache.gobblin.metrics.MetricReport.Builder setTimestamp(long value) { validate(fields()[1], value); this.timestamp = value; fieldSetFlags()[1] = true; return this; }
/** * Checks whether the 'tags' field has been set. * Tags associated with the metrics. * @return True if the 'tags' field has been set, false otherwise. */ public boolean hasTags() { return fieldSetFlags()[0]; }
/** * Sets the value of the 'tags' field. * Tags associated with the metrics. * @param value The value of 'tags'. * @return This builder. */ public org.apache.gobblin.metrics.MetricReport.Builder setTags(java.util.Map<java.lang.String,java.lang.String> value) { validate(fields()[0], value); this.tags = value; fieldSetFlags()[0] = true; return this; }
/** * Clears the value of the 'metrics' field. * Array of metrics in this report. * @return This builder. */ public org.apache.gobblin.metrics.MetricReport.Builder clearMetrics() { metrics = null; fieldSetFlags()[2] = false; return this; }
/** * Checks whether the 'tags' field has been set. * Tags associated with the metrics. * @return True if the 'tags' field has been set, false otherwise. */ public boolean hasTags() { return fieldSetFlags()[0]; }
/** * Clears the value of the 'timestamp' field. * Time at which metrics were reported. * @return This builder. */ public org.apache.gobblin.metrics.MetricReport.Builder clearTimestamp() { fieldSetFlags()[1] = false; return this; }
/** * Clears the value of the 'tags' field. * Tags associated with the metrics. * @return This builder. */ public org.apache.gobblin.metrics.MetricReport.Builder clearTags() { tags = null; fieldSetFlags()[0] = false; return this; }
/** * Sets the value of the 'tags' field. * Tags associated with the metrics. * @param value The value of 'tags'. * @return This builder. */ public org.apache.gobblin.metrics.MetricReport.Builder setTags(java.util.Map<java.lang.String,java.lang.String> value) { validate(fields()[0], value); this.tags = value; fieldSetFlags()[0] = true; return this; }
/** * Checks whether the 'metrics' field has been set. * Array of metrics in this report. * @return True if the 'metrics' field has been set, false otherwise. */ public boolean hasMetrics() { return fieldSetFlags()[2]; }
/** * Checks whether the 'timestamp' field has been set. * Time at which metrics were reported. * @return True if the 'timestamp' field has been set, false otherwise. */ public boolean hasTimestamp() { return fieldSetFlags()[1]; }
/** * Sets the value of the 'metrics' field. * Array of metrics in this report. * @param value The value of 'metrics'. * @return This builder. */ public org.apache.gobblin.metrics.MetricReport.Builder setMetrics(java.util.List<org.apache.gobblin.metrics.Metric> value) { validate(fields()[2], value); this.metrics = value; fieldSetFlags()[2] = true; return this; }
/** * Sets the value of the 'timestamp' field. * Time at which metrics were reported. * @param value The value of 'timestamp'. * @return This builder. */ public org.apache.gobblin.metrics.MetricReport.Builder setTimestamp(long value) { validate(fields()[1], value); this.timestamp = value; fieldSetFlags()[1] = true; return this; }