/** Creates a Builder by copying an existing Builder */ private Builder(org.kitesdk.data.event.Value.Builder other) { super(other); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); 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 Value instance */ private Builder(org.kitesdk.data.event.Value other) { super(org.kitesdk.data.event.Value.SCHEMA$); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.value)) { this.value = data().deepCopy(fields()[1].schema(), other.value); fieldSetFlags()[1] = true; } }
@Override public Value build() { try { Value record = new Value(); record.id = fieldSetFlags()[0] ? this.id : (java.lang.String) defaultValue(fields()[0]); record.value = fieldSetFlags()[1] ? this.value : (java.lang.Long) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** Checks whether the 'value' field has been set */ public boolean hasValue() { return fieldSetFlags()[1]; }
/** Clears the value of the 'id' field */ public org.kitesdk.data.event.Value.Builder clearId() { id = null; fieldSetFlags()[0] = false; return this; }
/** Clears the value of the 'value' field */ public org.kitesdk.data.event.Value.Builder clearValue() { fieldSetFlags()[1] = false; return this; }
/** Sets the value of the 'value' field */ public org.kitesdk.data.event.Value.Builder setValue(long value) { validate(fields()[1], value); this.value = value; fieldSetFlags()[1] = true; return this; }
/** Checks whether the 'id' field has been set */ public boolean hasId() { return fieldSetFlags()[0]; }
/** Sets the value of the 'id' field */ public org.kitesdk.data.event.Value.Builder setId(java.lang.String value) { validate(fields()[0], value); this.id = value; fieldSetFlags()[0] = true; return this; }