/** * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ private Builder(org.apache.gobblin.metrics.Metric.Builder other) { super(other); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.value)) { this.value = data().deepCopy(fields()[1].schema(), other.value); fieldSetFlags()[1] = true; } }
/** * Creates a Builder by copying an existing Metric instance * @param other The existing instance to copy. */ private Builder(org.apache.gobblin.metrics.Metric other) { super(SCHEMA$); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.value)) { this.value = data().deepCopy(fields()[1].schema(), other.value); fieldSetFlags()[1] = true; } }
@Override public Metric build() { try { Metric record = new Metric(); record.name = fieldSetFlags()[0] ? this.name : (java.lang.String) defaultValue(fields()[0]); record.value = fieldSetFlags()[1] ? this.value : (java.lang.Double) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ private Builder(org.apache.gobblin.metrics.Metric.Builder other) { super(other); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.value)) { this.value = data().deepCopy(fields()[1].schema(), other.value); fieldSetFlags()[1] = true; } }
/** * Creates a Builder by copying an existing Metric instance * @param other The existing instance to copy. */ private Builder(org.apache.gobblin.metrics.Metric other) { super(SCHEMA$); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.value)) { this.value = data().deepCopy(fields()[1].schema(), other.value); fieldSetFlags()[1] = true; } }
/** * Checks whether the 'value' field has been set. * Metric value. * @return True if the 'value' field has been set, false otherwise. */ public boolean hasValue() { return fieldSetFlags()[1]; }
/** * Clears the value of the 'name' field. * Metric name. * @return This builder. */ public org.apache.gobblin.metrics.Metric.Builder clearName() { name = null; fieldSetFlags()[0] = false; return this; }
/** * Checks whether the 'name' field has been set. * Metric name. * @return True if the 'name' field has been set, false otherwise. */ public boolean hasName() { return fieldSetFlags()[0]; }
/** * Sets the value of the 'value' field. * Metric value. * @param value The value of 'value'. * @return This builder. */ public org.apache.gobblin.metrics.Metric.Builder setValue(double value) { validate(fields()[1], value); this.value = value; fieldSetFlags()[1] = true; return this; }
/** * Clears the value of the 'value' field. * Metric value. * @return This builder. */ public org.apache.gobblin.metrics.Metric.Builder clearValue() { fieldSetFlags()[1] = false; return this; }
/** * Sets the value of the 'name' field. * Metric name. * @param value The value of 'name'. * @return This builder. */ public org.apache.gobblin.metrics.Metric.Builder setName(java.lang.String value) { validate(fields()[0], value); this.name = value; fieldSetFlags()[0] = true; return this; }
@Override public Metric build() { try { Metric record = new Metric(); record.name = fieldSetFlags()[0] ? this.name : (java.lang.String) defaultValue(fields()[0]); record.value = fieldSetFlags()[1] ? this.value : (java.lang.Double) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** * Clears the value of the 'value' field. * Metric value. * @return This builder. */ public org.apache.gobblin.metrics.Metric.Builder clearValue() { fieldSetFlags()[1] = false; return this; }
/** * Clears the value of the 'name' field. * Metric name. * @return This builder. */ public org.apache.gobblin.metrics.Metric.Builder clearName() { name = null; fieldSetFlags()[0] = false; return this; }
/** * Sets the value of the 'value' field. * Metric value. * @param value The value of 'value'. * @return This builder. */ public org.apache.gobblin.metrics.Metric.Builder setValue(double value) { validate(fields()[1], value); this.value = value; fieldSetFlags()[1] = true; return this; }
/** * Checks whether the 'value' field has been set. * Metric value. * @return True if the 'value' field has been set, false otherwise. */ public boolean hasValue() { return fieldSetFlags()[1]; }
/** * Sets the value of the 'name' field. * Metric name. * @param value The value of 'name'. * @return This builder. */ public org.apache.gobblin.metrics.Metric.Builder setName(java.lang.String value) { validate(fields()[0], value); this.name = value; fieldSetFlags()[0] = true; return this; }
/** * Checks whether the 'name' field has been set. * Metric name. * @return True if the 'name' field has been set, false otherwise. */ public boolean hasName() { return fieldSetFlags()[0]; }