1 package eu
.etaxonomy
.cdm
.api
.service
.dto
;
4 import java
.util
.ArrayList
;
5 import java
.util
.HashMap
;
9 import org
.hibernate
.envers
.tools
.Pair
;
11 public class DerivateHierarchyDTO
{
14 private boolean hasDna
;
15 private boolean hasDetailImage
;
18 private String country
;
19 private String collection
;
21 private String herbarium
;
22 private boolean hasType
;
23 private boolean hasSpecimenScan
;
26 private String taxonName
;
27 private String protologue
;
28 private String citation
;
29 private Map
<String
, List
<String
>> types
;
30 private List
<Pair
<String
, String
>> specimenScans
;
31 private List
<MolecularData
> molecularDataList
;
32 private List
<Pair
<String
, String
>> detailImages
;
35 * @return the molecularData
37 public List
<MolecularData
> getMolecularDataList() {
38 return molecularDataList
;
41 public MolecularData
addProviderLink(URI uri
, String linkText
) {
42 if(this.molecularDataList
==null){
43 molecularDataList
= new ArrayList
<DerivateHierarchyDTO
.MolecularData
>();
45 MolecularData molecularData
= new MolecularData(new Link(uri
, linkText
));
46 this.molecularDataList
.add(molecularData
);
53 public boolean isHasDna() {
57 * @param hasDna the hasDna to set
59 public void setHasDna(boolean hasDna
) {
63 * @return the hasDetailImage
65 public boolean isHasDetailImage() {
66 return hasDetailImage
;
69 * @param hasDetailImage the hasDetailImage to set
71 public void setHasDetailImage(boolean hasDetailImage
) {
72 this.hasDetailImage
= hasDetailImage
;
77 public String
getCountry() {
81 * @param country the country to set
83 public void setCountry(String country
) {
84 this.country
= country
;
87 * @return the collection
89 public String
getCollection() {
93 * @param collection the collection to set
95 public void setCollection(String collection
) {
96 this.collection
= collection
;
101 public String
getDate() {
105 * @param date the date to set
107 public void setDate(String date
) {
111 * @return the herbarium
113 public String
getHerbarium() {
117 * @param herbarium the herbarium to set
119 public void setHerbarium(String herbarium
) {
120 this.herbarium
= herbarium
;
123 * @return the hasType
125 public boolean isHasType() {
129 * @param hasType the hasType to set
131 public void setHasType(boolean hasType
) {
132 this.hasType
= hasType
;
135 * @return the hasSpecimenScan
137 public boolean isHasSpecimenScan() {
138 return hasSpecimenScan
;
141 * @param hasSpecimenScan the hasSpecimenScan to set
143 public void setHasSpecimenScan(boolean hasSpecimenScan
) {
144 this.hasSpecimenScan
= hasSpecimenScan
;
147 * @return the taxonName
149 public String
getTaxonName() {
153 * @param taxonName the taxonName to set
155 public void setTaxonName(String taxonName
) {
156 this.taxonName
= taxonName
;
159 * @return the protologue
161 public String
getProtologue() {
165 * @param protologue the protologue to set
167 public void setProtologue(String protologue
) {
168 this.protologue
= protologue
;
171 * @return the citation
173 public String
getCitation() {
177 * @param citation the citation to set
179 public void setCitation(String citation
) {
180 this.citation
= citation
;
184 * @param types the types to set
186 public void setTypes(Map
<String
, List
<String
>> types
) {
192 public Map
<String
, List
<String
>> getTypes() {
195 public void addTypes(String typeStatus
, String accessionNumber
){
197 types
= new HashMap
<String
, List
<String
>>();
199 List
<String
> list
= types
.get(typeStatus
);
201 list
= new ArrayList
<String
>();
203 list
.add(accessionNumber
);
204 types
.put(typeStatus
, list
);
208 * @param specimenScans the specimenScans to set
210 public void setSpecimenScans(List
<Pair
<String
, String
>> specimenScans
) {
211 this.specimenScans
= specimenScans
;
214 * @return the specimenScans
216 public List
<Pair
<String
, String
>> getSpecimenScans() {
217 return specimenScans
;
220 public void addSpecimenScan(String uri
, String herbarium
){
221 if(specimenScans
==null){
222 specimenScans
= new ArrayList
<Pair
<String
,String
>>();
224 specimenScans
.add(new Pair
<String
, String
>(uri
, herbarium
));
228 * @return the detailImages
230 public List
<Pair
<String
, String
>> getDetailImages() {
234 * @param detailImages the detailImages to set
236 public void setDetailImages(List
<Pair
<String
, String
>> detailImages
) {
237 this.detailImages
= detailImages
;
240 public void addDetailImage(String uri
, String motif
){
241 if(detailImages
==null){
242 detailImages
= new ArrayList
<Pair
<String
,String
>>();
244 detailImages
.add(new Pair
<String
, String
>(uri
, motif
));
247 public class MolecularData
{
248 private final Link providerLink
;
249 private List
<ContigFile
> contigFiles
;
251 public MolecularData(Link providerLink
) {
253 this.providerLink
= providerLink
;
256 public ContigFile
addContigFile(URI uri
, String linkText
){
257 if(contigFiles
==null){
258 contigFiles
= new ArrayList
<DerivateHierarchyDTO
.ContigFile
>();
260 ContigFile contigFile
= new ContigFile(new Link(uri
, linkText
));
261 contigFiles
.add(contigFile
);
265 public synchronized Link
getProviderLink() {
269 public List
<ContigFile
> getContigFiles() {
275 public class ContigFile
{
276 private final Link contigLink
;
277 private List
<Link
> primerLinks
;
279 public ContigFile(Link contigLink
) {
280 this.contigLink
= contigLink
;
283 public void addPrimerLink(URI uri
, String linkText
){
284 if(primerLinks
==null){
285 primerLinks
= new ArrayList
<DerivateHierarchyDTO
.Link
>();
287 primerLinks
.add(new Link(uri
, linkText
));
290 public Link
getContigLink() {
294 public List
<Link
> getPrimerLinks() {
301 private String linkText
;
304 public Link(URI uri
, String linkText
) {
306 this.linkText
= linkText
;
310 * @return the linkText
312 public synchronized String
getLinkText() {
316 * @param linkText the linkText to set
318 public synchronized void setLinkText(String linkText
) {
319 this.linkText
= linkText
;
324 public synchronized URI
getUri() {
328 * @param uri the uri to set
330 public synchronized void setUri(URI uri
) {
334 * @see java.lang.Object#hashCode()
337 public int hashCode() {
338 final int prime
= 31;
340 result
= prime
* result
+ ((linkText
== null) ?
0 : linkText
.hashCode());
341 result
= prime
* result
+ ((uri
== null) ?
0 : uri
.hashCode());
345 * @see java.lang.Object#equals(java.lang.Object)
348 public boolean equals(Object obj
) {
355 if (getClass() != obj
.getClass()) {
358 Link other
= (Link
) obj
;
359 if (linkText
== null) {
360 if (other
.linkText
!= null) {
363 } else if (!linkText
.equals(other
.linkText
)) {
367 if (other
.uri
!= null) {
370 } else if (!uri
.equals(other
.uri
)) {