/** * Returns the sample contamination or CONTAMINATION_FRACTION if no contamination level was specified for this sample. */ public Double getSampleContamination(final String sampleId){ Utils.nonNull(sampleId); if (sampleContamination == null){ setSampleContamination(new DefaultedMap<>(CONTAMINATION_FRACTION));//default to empty map } return sampleContamination.get(sampleId); }
@Override public void afterPropertiesSet() { currentValueMap = DefaultedMap.defaultedMap(new HashMap<String, Long>(), Long.valueOf(0L)); lockMap = new HashMap<String, Lock>(); }
public void setSampleContamination(final DefaultedMap<String, Double> sampleContamination) { this.sampleContamination = new DefaultedMap<>(CONTAMINATION_FRACTION); //NOTE: a bit weird because it ignores the default from the argument and uses ours this.sampleContamination.putAll(sampleContamination); //make a copy to be safe }