/** * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ private Builder(org.apache.gobblin.metrics.FlatGobblinMetric.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.metricName)) { this.metricName = data().deepCopy(fields()[2].schema(), other.metricName); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.metricValue)) { this.metricValue = data().deepCopy(fields()[3].schema(), other.metricValue); fieldSetFlags()[3] = true; } }
/** * Creates a Builder by copying an existing FlatGobblinMetric instance * @param other The existing instance to copy. */ private Builder(org.apache.gobblin.metrics.FlatGobblinMetric 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.metricName)) { this.metricName = data().deepCopy(fields()[2].schema(), other.metricName); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.metricValue)) { this.metricValue = data().deepCopy(fields()[3].schema(), other.metricValue); fieldSetFlags()[3] = true; } }
@Override public FlatGobblinMetric build() { try { FlatGobblinMetric record = new FlatGobblinMetric(); record.tags = fieldSetFlags()[0] ? this.tags : (java.util.List<java.lang.String>) defaultValue(fields()[0]); record.timestamp = fieldSetFlags()[1] ? this.timestamp : (java.lang.Long) defaultValue(fields()[1]); record.metricName = fieldSetFlags()[2] ? this.metricName : (java.lang.String) defaultValue(fields()[2]); record.metricValue = fieldSetFlags()[3] ? this.metricValue : (java.lang.Double) defaultValue(fields()[3]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** * Creates a Builder by copying an existing FlatGobblinMetric instance * @param other The existing instance to copy. */ private Builder(org.apache.gobblin.metrics.FlatGobblinMetric 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.metricName)) { this.metricName = data().deepCopy(fields()[2].schema(), other.metricName); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.metricValue)) { this.metricValue = data().deepCopy(fields()[3].schema(), other.metricValue); fieldSetFlags()[3] = true; } }
/** * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ private Builder(org.apache.gobblin.metrics.FlatGobblinMetric.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.metricName)) { this.metricName = data().deepCopy(fields()[2].schema(), other.metricName); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.metricValue)) { this.metricValue = data().deepCopy(fields()[3].schema(), other.metricValue); fieldSetFlags()[3] = true; } }
@Override public FlatGobblinMetric build() { try { FlatGobblinMetric record = new FlatGobblinMetric(); record.tags = fieldSetFlags()[0] ? this.tags : (java.util.List<java.lang.String>) defaultValue(fields()[0]); record.timestamp = fieldSetFlags()[1] ? this.timestamp : (java.lang.Long) defaultValue(fields()[1]); record.metricName = fieldSetFlags()[2] ? this.metricName : (java.lang.String) defaultValue(fields()[2]); record.metricValue = fieldSetFlags()[3] ? this.metricValue : (java.lang.Double) defaultValue(fields()[3]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** * Sets the value of the 'tags' field. * Tags associated with the metrics in the form key:value. * @param value The value of 'tags'. * @return This builder. */ public org.apache.gobblin.metrics.FlatGobblinMetric.Builder setTags(java.util.List<java.lang.String> value) { validate(fields()[0], value); this.tags = value; fieldSetFlags()[0] = true; return this; }
/** * Sets the value of the 'metricValue' field. * The value of this metric. * @param value The value of 'metricValue'. * @return This builder. */ public org.apache.gobblin.metrics.FlatGobblinMetric.Builder setMetricValue(double value) { validate(fields()[3], value); this.metricValue = value; fieldSetFlags()[3] = true; return this; }
/** * Sets the value of the 'metricName' field. * The name of this metric. * @param value The value of 'metricName'. * @return This builder. */ public org.apache.gobblin.metrics.FlatGobblinMetric.Builder setMetricName(java.lang.String value) { validate(fields()[2], value); this.metricName = 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.FlatGobblinMetric.Builder setTimestamp(long value) { validate(fields()[1], value); this.timestamp = value; fieldSetFlags()[1] = true; return this; }
/** * Sets the value of the 'metricValue' field. * The value of this metric. * @param value The value of 'metricValue'. * @return This builder. */ public org.apache.gobblin.metrics.FlatGobblinMetric.Builder setMetricValue(double value) { validate(fields()[3], value); this.metricValue = value; fieldSetFlags()[3] = 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.FlatGobblinMetric.Builder setTimestamp(long value) { validate(fields()[1], value); this.timestamp = value; fieldSetFlags()[1] = true; return this; }
/** * Sets the value of the 'metricName' field. * The name of this metric. * @param value The value of 'metricName'. * @return This builder. */ public org.apache.gobblin.metrics.FlatGobblinMetric.Builder setMetricName(java.lang.String value) { validate(fields()[2], value); this.metricName = value; fieldSetFlags()[2] = true; return this; }
/** * Sets the value of the 'tags' field. * Tags associated with the metrics in the form key:value. * @param value The value of 'tags'. * @return This builder. */ public org.apache.gobblin.metrics.FlatGobblinMetric.Builder setTags(java.util.List<java.lang.String> value) { validate(fields()[0], value); this.tags = value; fieldSetFlags()[0] = true; return this; }