/** Creates a Builder by copying an existing AlternateCoordinate instance */ private Builder(org.opencb.biodata.models.variant.avro.AlternateCoordinate other) { super(org.opencb.biodata.models.variant.avro.AlternateCoordinate.SCHEMA$); if (isValidValue(fields()[0], other.chromosome)) { this.chromosome = data().deepCopy(fields()[0].schema(), other.chromosome); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.start)) { this.start = data().deepCopy(fields()[1].schema(), other.start); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.end)) { this.end = data().deepCopy(fields()[2].schema(), other.end); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.reference)) { this.reference = data().deepCopy(fields()[3].schema(), other.reference); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.alternate)) { this.alternate = data().deepCopy(fields()[4].schema(), other.alternate); fieldSetFlags()[4] = true; } if (isValidValue(fields()[5], other.type)) { this.type = data().deepCopy(fields()[5].schema(), other.type); fieldSetFlags()[5] = true; } }
/** Creates a Builder by copying an existing Builder */ private Builder(org.opencb.biodata.models.variant.avro.AlternateCoordinate.Builder other) { super(other); if (isValidValue(fields()[0], other.chromosome)) { this.chromosome = data().deepCopy(fields()[0].schema(), other.chromosome); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.start)) { this.start = data().deepCopy(fields()[1].schema(), other.start); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.end)) { this.end = data().deepCopy(fields()[2].schema(), other.end); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.reference)) { this.reference = data().deepCopy(fields()[3].schema(), other.reference); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.alternate)) { this.alternate = data().deepCopy(fields()[4].schema(), other.alternate); fieldSetFlags()[4] = true; } if (isValidValue(fields()[5], other.type)) { this.type = data().deepCopy(fields()[5].schema(), other.type); fieldSetFlags()[5] = true; } }
@Override public AlternateCoordinate build() { try { AlternateCoordinate record = new AlternateCoordinate(); record.chromosome = fieldSetFlags()[0] ? this.chromosome : (java.lang.String) defaultValue(fields()[0]); record.start = fieldSetFlags()[1] ? this.start : (java.lang.Integer) defaultValue(fields()[1]); record.end = fieldSetFlags()[2] ? this.end : (java.lang.Integer) defaultValue(fields()[2]); record.reference = fieldSetFlags()[3] ? this.reference : (java.lang.String) defaultValue(fields()[3]); record.alternate = fieldSetFlags()[4] ? this.alternate : (java.lang.String) defaultValue(fields()[4]); record.type = fieldSetFlags()[5] ? this.type : (org.opencb.biodata.models.variant.avro.VariantType) defaultValue(fields()[5]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** Sets the value of the 'type' field */ public org.opencb.biodata.models.variant.avro.AlternateCoordinate.Builder setType(org.opencb.biodata.models.variant.avro.VariantType value) { validate(fields()[5], value); this.type = value; fieldSetFlags()[5] = true; return this; }
/** Sets the value of the 'start' field */ public org.opencb.biodata.models.variant.avro.AlternateCoordinate.Builder setStart(java.lang.Integer value) { validate(fields()[1], value); this.start = value; fieldSetFlags()[1] = true; return this; }
/** Sets the value of the 'alternate' field */ public org.opencb.biodata.models.variant.avro.AlternateCoordinate.Builder setAlternate(java.lang.String value) { validate(fields()[4], value); this.alternate = value; fieldSetFlags()[4] = true; return this; }
/** Sets the value of the 'end' field */ public org.opencb.biodata.models.variant.avro.AlternateCoordinate.Builder setEnd(java.lang.Integer value) { validate(fields()[2], value); this.end = value; fieldSetFlags()[2] = true; return this; }
/** Sets the value of the 'chromosome' field */ public org.opencb.biodata.models.variant.avro.AlternateCoordinate.Builder setChromosome(java.lang.String value) { validate(fields()[0], value); this.chromosome = value; fieldSetFlags()[0] = true; return this; }
/** Sets the value of the 'reference' field */ public org.opencb.biodata.models.variant.avro.AlternateCoordinate.Builder setReference(java.lang.String value) { validate(fields()[3], value); this.reference = value; fieldSetFlags()[3] = true; return this; }