Revision 2720ea2c
Added by Andreas Müller over 3 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/csv/redlist/out/CsvId.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2009 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
20 | 20 |
/** |
21 | 21 |
* @author a.mueller |
22 | 22 |
* @since 29.04.2011 |
23 |
* |
|
24 | 23 |
*/ |
25 | 24 |
public class CsvId { |
25 |
|
|
26 | 26 |
@SuppressWarnings("unused") |
27 | 27 |
private static final Logger logger = Logger.getLogger(CsvId.class); |
28 | 28 |
|
... | ... | |
31 | 31 |
private UUID uuidId; |
32 | 32 |
private URI uriId; |
33 | 33 |
private LSID lsidId; |
34 |
|
|
34 |
|
|
35 | 35 |
private CsvTaxExportConfiguratorRedlist config; |
36 |
|
|
36 |
|
|
37 | 37 |
public CsvId(CsvTaxExportConfiguratorRedlist config){ |
38 | 38 |
this.config = config; |
39 | 39 |
} |
40 |
|
|
40 |
|
|
41 | 41 |
public void setId(Integer id){ |
42 | 42 |
this.intId = id; |
43 | 43 |
} |
... | ... | |
47 | 47 |
public void setId(LSID lsid){ |
48 | 48 |
this.lsidId = lsid; |
49 | 49 |
} |
50 |
|
|
51 | 50 |
|
52 | 51 |
public void setId(CdmBase cdmBase) { |
53 | 52 |
this.setId(cdmBase.getId()); |
... | ... | |
56 | 55 |
this.setId(CdmBase.deproxy(cdmBase,IdentifiableEntity.class).getLsid()); |
57 | 56 |
} |
58 | 57 |
} |
59 |
|
|
58 |
|
|
60 | 59 |
public String getId(){ |
61 | 60 |
Object object; |
62 | 61 |
if (config.isUseIdWherePossible()){ |
... | ... | |
74 | 73 |
} |
75 | 74 |
return nullSafe(object); |
76 | 75 |
} |
77 |
|
|
76 |
|
|
78 | 77 |
private String nullSafe(Object o){ |
79 | 78 |
return o == null ? null : o.toString(); |
80 | 79 |
} |
81 |
|
|
82 |
|
|
83 |
} |
|
80 |
} |
Also available in: Unified diff
cleanup