public void copy(StudyConfiguration other) { this.studyId = other.studyId; this.studyName = other.studyName; this.fileIds = HashBiMap.create(other.fileIds == null ? Collections.emptyMap() : other.fileIds); this.filePaths = HashBiMap.create(other.filePaths == null ? Collections.emptyMap() : other.filePaths); this.sampleIds = HashBiMap.create(other.sampleIds == null ? Collections.emptyMap() : other.sampleIds); this.cohortIds = HashBiMap.create(other.cohortIds == null ? Collections.emptyMap() : other.cohortIds); this.cohorts = new HashMap<>(other.cohorts); this.indexedFiles = new LinkedHashSet<>(other.indexedFiles); this.headers = new HashMap<>(other.headers); this.samplesInFiles = new HashMap<>(other.samplesInFiles); this.calculatedStats = new LinkedHashSet<>(other.calculatedStats); this.invalidStats = new LinkedHashSet<>(other.invalidStats); this.searchIndexedSampleSets = other.searchIndexedSampleSets == null ? new HashMap<>() : new HashMap<>(other.searchIndexedSampleSets); this.searchIndexedSampleSetsStatus = other.searchIndexedSampleSetsStatus == null ? new HashMap<>() : new HashMap<>(other.searchIndexedSampleSetsStatus); this.batches = new ArrayList<>(other.batches.size()); for (BatchFileOperation batch : other.batches) { this.batches.add(new BatchFileOperation(batch)); } this.aggregation = other.aggregation; this.timeStamp = other.timeStamp; if (other.variantHeader == null) { this.variantHeader = VariantFileHeader.newBuilder().setVersion("").build(); } else { this.variantHeader = VariantFileHeader.newBuilder(other.variantHeader).setVersion("").build(); } this.attributes = new ObjectMap(other.attributes); }
/** Creates a Builder by copying an existing Builder */ private Builder(org.opencb.biodata.models.variant.metadata.VariantFileHeader.Builder other) { super(other); if (isValidValue(fields()[0], other.version)) { this.version = data().deepCopy(fields()[0].schema(), other.version); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.complexLines)) { this.complexLines = data().deepCopy(fields()[1].schema(), other.complexLines); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.simpleLines)) { this.simpleLines = data().deepCopy(fields()[2].schema(), other.simpleLines); fieldSetFlags()[2] = true; } }
public StudyConfiguration(int studyId, String studyName, Map<String, Integer> fileIds, Map<String, Integer> sampleIds, Map<String, Integer> cohortIds, Map<Integer, Set<Integer>> cohorts) { this.studyId = studyId; this.studyName = studyName; this.fileIds = HashBiMap.create(fileIds == null ? Collections.emptyMap() : fileIds); this.filePaths = HashBiMap.create(); this.sampleIds = HashBiMap.create(sampleIds == null ? Collections.emptyMap() : sampleIds); this.cohortIds = HashBiMap.create(cohortIds == null ? Collections.emptyMap() : cohortIds); this.cohorts = cohorts == null ? new HashMap<>() : cohorts; this.indexedFiles = new LinkedHashSet<>(); this.headers = new HashMap<>(); this.samplesInFiles = new HashMap<>(); this.calculatedStats = new LinkedHashSet<>(); this.invalidStats = new LinkedHashSet<>(); this.searchIndexedSampleSets = new HashMap<>(); this.searchIndexedSampleSetsStatus = new HashMap<>(); this.batches = new ArrayList<>(); this.aggregation = Aggregation.NONE; this.timeStamp = 0L; this.variantHeader = VariantFileHeader.newBuilder().setVersion("").build(); this.attributes = new ObjectMap(); }
/** Checks whether the 'simpleLines' field has been set */ public boolean hasSimpleLines() { return fieldSetFlags()[2]; }
/** Creates a Builder by copying an existing VariantFileHeader instance */ private Builder(org.opencb.biodata.models.variant.metadata.VariantFileHeader other) { super(org.opencb.biodata.models.variant.metadata.VariantFileHeader.SCHEMA$); if (isValidValue(fields()[0], other.version)) { this.version = data().deepCopy(fields()[0].schema(), other.version); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.complexLines)) { this.complexLines = data().deepCopy(fields()[1].schema(), other.complexLines); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.simpleLines)) { this.simpleLines = data().deepCopy(fields()[2].schema(), other.simpleLines); fieldSetFlags()[2] = true; } }
@Override public VariantFileHeader build() { try { VariantFileHeader record = new VariantFileHeader(); record.version = fieldSetFlags()[0] ? this.version : (java.lang.String) defaultValue(fields()[0]); record.complexLines = fieldSetFlags()[1] ? this.complexLines : (java.util.List<org.opencb.biodata.models.variant.metadata.VariantFileHeaderComplexLine>) defaultValue(fields()[1]); record.simpleLines = fieldSetFlags()[2] ? this.simpleLines : (java.util.List<org.opencb.biodata.models.variant.metadata.VariantFileHeaderSimpleLine>) defaultValue(fields()[2]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** Clears the value of the 'simpleLines' field */ public org.opencb.biodata.models.variant.metadata.VariantFileHeader.Builder clearSimpleLines() { simpleLines = null; fieldSetFlags()[2] = false; return this; }
/** Creates a new VariantFileHeader RecordBuilder by copying an existing Builder */ public static org.opencb.biodata.models.variant.metadata.VariantFileHeader.Builder newBuilder(org.opencb.biodata.models.variant.metadata.VariantFileHeader.Builder other) { return new org.opencb.biodata.models.variant.metadata.VariantFileHeader.Builder(other); }
/** Creates a new VariantFileHeader RecordBuilder */ public static org.opencb.biodata.models.variant.metadata.VariantFileHeader.Builder newBuilder() { return new org.opencb.biodata.models.variant.metadata.VariantFileHeader.Builder(); }
/** Checks whether the 'version' field has been set */ public boolean hasVersion() { return fieldSetFlags()[0]; }
/** Checks whether the 'complexLines' field has been set */ public boolean hasComplexLines() { return fieldSetFlags()[1]; }
/** Creates a new VariantFileHeader RecordBuilder by copying an existing VariantFileHeader instance */ public static org.opencb.biodata.models.variant.metadata.VariantFileHeader.Builder newBuilder(org.opencb.biodata.models.variant.metadata.VariantFileHeader other) { return new org.opencb.biodata.models.variant.metadata.VariantFileHeader.Builder(other); }
/** Sets the value of the 'simpleLines' field */ public org.opencb.biodata.models.variant.metadata.VariantFileHeader.Builder setSimpleLines(java.util.List<org.opencb.biodata.models.variant.metadata.VariantFileHeaderSimpleLine> value) { validate(fields()[2], value); this.simpleLines = value; fieldSetFlags()[2] = true; return this; }
/** Sets the value of the 'version' field */ public org.opencb.biodata.models.variant.metadata.VariantFileHeader.Builder setVersion(java.lang.String value) { validate(fields()[0], value); this.version = value; fieldSetFlags()[0] = true; return this; }
/** Clears the value of the 'version' field */ public org.opencb.biodata.models.variant.metadata.VariantFileHeader.Builder clearVersion() { version = null; fieldSetFlags()[0] = false; return this; }
/** Clears the value of the 'complexLines' field */ public org.opencb.biodata.models.variant.metadata.VariantFileHeader.Builder clearComplexLines() { complexLines = null; fieldSetFlags()[1] = false; return this; }
/** Sets the value of the 'complexLines' field */ public org.opencb.biodata.models.variant.metadata.VariantFileHeader.Builder setComplexLines(java.util.List<org.opencb.biodata.models.variant.metadata.VariantFileHeaderComplexLine> value) { validate(fields()[1], value); this.complexLines = value; fieldSetFlags()[1] = true; return this; }