1
|
/**
|
2
|
* Copyright (C) 2018 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.persistence.dto;
|
10
|
|
11
|
import java.util.UUID;
|
12
|
|
13
|
import eu.etaxonomy.cdm.model.name.Rank;
|
14
|
|
15
|
public class TaxonNameParts {
|
16
|
|
17
|
protected Integer taxonNameId;
|
18
|
|
19
|
protected UUID taxonNameUuid;
|
20
|
|
21
|
protected Rank rank;
|
22
|
|
23
|
protected String genusOrUninomial;
|
24
|
|
25
|
protected String infraGenericEpithet;
|
26
|
|
27
|
protected String specificEpithet;
|
28
|
|
29
|
protected String infraSpecificEpithet;
|
30
|
|
31
|
/**
|
32
|
* @return the taxonNameId
|
33
|
*/
|
34
|
public Integer getTaxonNameId() {
|
35
|
return taxonNameId;
|
36
|
}
|
37
|
|
38
|
|
39
|
/**
|
40
|
* @param taxonNameId the taxonNameId to set
|
41
|
*/
|
42
|
public void setTaxonNameId(Integer taxonNameId) {
|
43
|
this.taxonNameId = taxonNameId;
|
44
|
}
|
45
|
|
46
|
|
47
|
/**
|
48
|
* @return the rank
|
49
|
*/
|
50
|
public Rank getRank() {
|
51
|
return rank;
|
52
|
}
|
53
|
|
54
|
|
55
|
/**
|
56
|
* @param rank the rank to set
|
57
|
*/
|
58
|
public void setRank(Rank rank) {
|
59
|
this.rank = rank;
|
60
|
}
|
61
|
|
62
|
|
63
|
/**
|
64
|
* @return the uninomial
|
65
|
*/
|
66
|
public String getGenusOrUninomial() {
|
67
|
return genusOrUninomial;
|
68
|
}
|
69
|
|
70
|
|
71
|
/**
|
72
|
* @param uninomial the genusOrUninomial to set
|
73
|
*/
|
74
|
public void setGenusOrUninomial(String genusOrUninomial) {
|
75
|
this.genusOrUninomial = genusOrUninomial;
|
76
|
}
|
77
|
|
78
|
|
79
|
/**
|
80
|
* @return the infraGenericEpithet
|
81
|
*/
|
82
|
public String getInfraGenericEpithet() {
|
83
|
return infraGenericEpithet;
|
84
|
}
|
85
|
|
86
|
|
87
|
/**
|
88
|
* @param infraGenericEpithet the infraGenericEpithet to set
|
89
|
*/
|
90
|
public void setInfraGenericEpithet(String infraGenericEpithet) {
|
91
|
this.infraGenericEpithet = infraGenericEpithet;
|
92
|
}
|
93
|
|
94
|
|
95
|
/**
|
96
|
* @return the specificEpithet
|
97
|
*/
|
98
|
public String getSpecificEpithet() {
|
99
|
return specificEpithet;
|
100
|
}
|
101
|
|
102
|
|
103
|
/**
|
104
|
* @param specificEpithet the specificEpithet to set
|
105
|
*/
|
106
|
public void setSpecificEpithet(String specificEpithet) {
|
107
|
this.specificEpithet = specificEpithet;
|
108
|
}
|
109
|
|
110
|
|
111
|
/**
|
112
|
* @return the infraSpecificEpithet
|
113
|
*/
|
114
|
public String getInfraSpecificEpithet() {
|
115
|
return infraSpecificEpithet;
|
116
|
}
|
117
|
|
118
|
|
119
|
/**
|
120
|
* @param infraSpecificEpithet the infraSpecificEpithet to set
|
121
|
*/
|
122
|
public void setInfraSpecificEpithet(String infraSpecificEpithet) {
|
123
|
this.infraSpecificEpithet = infraSpecificEpithet;
|
124
|
}
|
125
|
|
126
|
|
127
|
/**
|
128
|
* @param taxonNameId
|
129
|
* @param taxonNameUuid
|
130
|
* @param rank
|
131
|
* @param uninomial
|
132
|
* @param infraGenericEpithet
|
133
|
* @param specificEpithet
|
134
|
* @param infraSpecificEpithet
|
135
|
*/
|
136
|
public TaxonNameParts(Integer taxonNameId, UUID taxonNameUuid, Rank rank, String genusOrUninomial, String infraGenericEpithet,
|
137
|
String specificEpithet, String infraSpecificEpithet) {
|
138
|
super();
|
139
|
this.taxonNameId = taxonNameId;
|
140
|
this.taxonNameUuid = taxonNameUuid;
|
141
|
this.rank = rank;
|
142
|
this.genusOrUninomial = genusOrUninomial;
|
143
|
this.infraGenericEpithet = infraGenericEpithet;
|
144
|
this.specificEpithet = specificEpithet;
|
145
|
this.infraSpecificEpithet = infraSpecificEpithet;
|
146
|
}
|
147
|
|
148
|
|
149
|
/**
|
150
|
*
|
151
|
*/
|
152
|
public TaxonNameParts() {
|
153
|
}
|
154
|
|
155
|
|
156
|
/**
|
157
|
* @param tn
|
158
|
* @return
|
159
|
*/
|
160
|
public String rankSpecificNamePart() {
|
161
|
if(rank.isGenus() || rank.isHigher(Rank.GENUS())){
|
162
|
return getGenusOrUninomial();
|
163
|
}
|
164
|
if(rank.isInfraGeneric()){
|
165
|
return getInfraGenericEpithet();
|
166
|
}
|
167
|
if(rank.isSpecies()){
|
168
|
return getSpecificEpithet();
|
169
|
}
|
170
|
if(rank.isInfraSpecific()){
|
171
|
return getInfraSpecificEpithet();
|
172
|
}
|
173
|
return "-- ERROR: INVALID OR UNSUPPORTED RANK (" + rank.getLabel() + ") --";
|
174
|
}
|
175
|
|
176
|
|
177
|
/**
|
178
|
* @return the taxonNameUuid
|
179
|
*/
|
180
|
public UUID getTaxonNameUuid() {
|
181
|
return taxonNameUuid;
|
182
|
}
|
183
|
|
184
|
}
|