Implement FormatKeys for all currently used occurrences parameters
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / format / occurrences / SingleReadFormatter.java
1 // $Id$
2 /**
3 * Copyright (C) 2015 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10 package eu.etaxonomy.cdm.format.occurrences;
11
12 import eu.etaxonomy.cdm.model.molecular.SingleRead;
13
14 /**
15 * @author pplitzner
16 * @date Nov 30, 2015
17 *
18 */
19 public class SingleReadFormatter extends AbstractCdmFormatter {
20
21 public SingleReadFormatter(Object object, FormatKey[] formatKeys) {
22 super(object, formatKeys);
23 }
24
25 @Override
26 protected void initFormatKeys(Object object, FormatKey... formatKeys) {
27 super.initFormatKeys(object);
28 SingleRead singleRead = (SingleRead)object;
29 if(singleRead.getPrimer()!=null){
30 formatKeyMap.put(FormatKey.SINGLE_READ_PRIMER, singleRead.getPrimer().getLabel());
31 }
32 if(singleRead.getAmplificationResult()!=null &&
33 singleRead.getAmplificationResult().getAmplification()!=null){
34 formatKeyMap.put(FormatKey.AMPLIFICATION_LABEL, singleRead.getAmplificationResult().getAmplification().getLabelCache());
35 }
36 }
37
38 }