/** Creates a Builder by copying an existing Builder */ private Builder(org.opencb.biodata.models.variant.metadata.ChromosomeStats.Builder other) { super(other); if (isValidValue(fields()[0], other.count)) { this.count = data().deepCopy(fields()[0].schema(), other.count); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.density)) { this.density = data().deepCopy(fields()[1].schema(), other.density); fieldSetFlags()[1] = true; } }
/** Creates a Builder by copying an existing ChromosomeStats instance */ private Builder(org.opencb.biodata.models.variant.metadata.ChromosomeStats other) { super(org.opencb.biodata.models.variant.metadata.ChromosomeStats.SCHEMA$); if (isValidValue(fields()[0], other.count)) { this.count = data().deepCopy(fields()[0].schema(), other.count); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.density)) { this.density = data().deepCopy(fields()[1].schema(), other.density); fieldSetFlags()[1] = true; } }
@Override public ChromosomeStats build() { try { ChromosomeStats record = new ChromosomeStats(); record.count = fieldSetFlags()[0] ? this.count : (java.lang.Integer) defaultValue(fields()[0]); record.density = fieldSetFlags()[1] ? this.density : (java.lang.Float) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** Checks whether the 'count' field has been set */ public boolean hasCount() { return fieldSetFlags()[0]; }
/** Checks whether the 'density' field has been set */ public boolean hasDensity() { return fieldSetFlags()[1]; }
/** Sets the value of the 'count' field */ public org.opencb.biodata.models.variant.metadata.ChromosomeStats.Builder setCount(int value) { validate(fields()[0], value); this.count = value; fieldSetFlags()[0] = true; return this; }
/** Clears the value of the 'density' field */ public org.opencb.biodata.models.variant.metadata.ChromosomeStats.Builder clearDensity() { fieldSetFlags()[1] = false; return this; }
/** Sets the value of the 'density' field */ public org.opencb.biodata.models.variant.metadata.ChromosomeStats.Builder setDensity(float value) { validate(fields()[1], value); this.density = value; fieldSetFlags()[1] = true; return this; }
/** Clears the value of the 'count' field */ public org.opencb.biodata.models.variant.metadata.ChromosomeStats.Builder clearCount() { fieldSetFlags()[0] = false; return this; }