1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2018 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.api.service.dto;
|
11
|
|
12
|
import eu.etaxonomy.cdm.model.description.SpecimenDescription;
|
13
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
14
|
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
|
15
|
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
|
16
|
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
|
17
|
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
|
18
|
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
|
19
|
|
20
|
/**
|
21
|
* @author pplitzner
|
22
|
* @since 16.04.2018
|
23
|
*
|
24
|
*/
|
25
|
public class SpecimenRowWrapperDTO extends RowWrapperDTO<SpecimenDescription> {
|
26
|
|
27
|
private static final long serialVersionUID = 5198447592554976471L;
|
28
|
|
29
|
private TaxonRowWrapperDTO defaultDescription;
|
30
|
private SpecimenOrObservationBaseDTO specimen;
|
31
|
private UuidAndTitleCache<FieldUnit> fieldUnit;
|
32
|
private SpecimenOrObservationType type;
|
33
|
private String identifier;
|
34
|
private NamedArea country;
|
35
|
|
36
|
public SpecimenRowWrapperDTO(DescriptionBaseDto description, SpecimenOrObservationType type, TaxonNodeDto taxonNode, FieldUnit fieldUnit, String identifier,
|
37
|
NamedArea country) {
|
38
|
super(description, taxonNode);
|
39
|
if (fieldUnit != null){
|
40
|
this.fieldUnit = new UuidAndTitleCache<>(fieldUnit.getUuid(), fieldUnit.getId(), fieldUnit.getTitleCache());
|
41
|
}
|
42
|
this.identifier = identifier;
|
43
|
this.country = country;
|
44
|
this.specimen = description.getSpecimenDto();
|
45
|
this.type = type;
|
46
|
}
|
47
|
|
48
|
|
49
|
public SpecimenRowWrapperDTO(SpecimenOrObservationBase specimen, TaxonNodeDto taxonNode, FieldUnit fieldUnit, String identifier,
|
50
|
NamedArea country) {
|
51
|
super(new DescriptionBaseDto(specimen), taxonNode);
|
52
|
if (fieldUnit != null){
|
53
|
this.fieldUnit = new UuidAndTitleCache<>(fieldUnit.getUuid(), fieldUnit.getId(), fieldUnit.getTitleCache());
|
54
|
}
|
55
|
this.identifier = identifier;
|
56
|
this.country = country;
|
57
|
this.specimen = SpecimenOrObservationDTOFactory.fromEntity(specimen);
|
58
|
this.type = specimen.getRecordBasis();
|
59
|
}
|
60
|
|
61
|
public SpecimenRowWrapperDTO(SpecimenOrObservationBase specimen, TaxonNodeDto taxonNode, UuidAndTitleCache<FieldUnit> fieldUnit, String identifier,
|
62
|
NamedArea country) {
|
63
|
super(new DescriptionBaseDto(specimen), taxonNode);
|
64
|
if (fieldUnit != null){
|
65
|
this.fieldUnit = fieldUnit;
|
66
|
}
|
67
|
this.identifier = identifier;
|
68
|
this.country = country;
|
69
|
this.specimen = SpecimenOrObservationDTOFactory.fromEntity(specimen);
|
70
|
this.type = specimen.getRecordBasis();
|
71
|
|
72
|
}
|
73
|
public SpecimenOrObservationBaseDTO getSpecimen() {
|
74
|
return specimen;
|
75
|
}
|
76
|
|
77
|
public UuidAndTitleCache<FieldUnit> getFieldUnit() {
|
78
|
return fieldUnit;
|
79
|
}
|
80
|
|
81
|
public String getIdentifier() {
|
82
|
return identifier;
|
83
|
}
|
84
|
|
85
|
public NamedArea getCountry() {
|
86
|
return country;
|
87
|
}
|
88
|
|
89
|
public void setDefaultDescription(TaxonRowWrapperDTO defaultDescription) {
|
90
|
this.defaultDescription = defaultDescription;
|
91
|
}
|
92
|
|
93
|
public TaxonRowWrapperDTO getDefaultDescription() {
|
94
|
return defaultDescription;
|
95
|
}
|
96
|
|
97
|
public SpecimenOrObservationType getType(){
|
98
|
return type;
|
99
|
}
|
100
|
}
|