74757677787980818283
public Sample loadSample(String reference) { Sample sample = database.get(reference); if (sample == null) { throw new ReferenceNotFoundException(reference); } return sample; }
154155156157158159160161162
* * @param reference the reference of the sample to be deleted */ public void deleteSample(String reference) { if (!database.containsKey(reference)) { throw new ReferenceNotFoundException(reference); } database.remove(reference); }
166167168169170171172173174
* * @param sample the updated sample */ public void updateSample(Sample sample) { if (!database.containsKey(sample.getReference())) { throw new ReferenceNotFoundException(sample.getReference()); } database.put(sample.getReference(), sample); }