1
|
package eu.etaxonomy.cdm.api.service.dto;
|
2
|
|
3
|
import java.util.ArrayList;
|
4
|
import java.util.List;
|
5
|
import java.util.UUID;
|
6
|
|
7
|
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
|
8
|
|
9
|
|
10
|
|
11
|
public class FieldUnitDTO extends DerivateDTO{
|
12
|
|
13
|
private static final long serialVersionUID = 3981843956067273220L;
|
14
|
|
15
|
//Row Attributes
|
16
|
private String country;
|
17
|
private String collectionString;
|
18
|
private String date;
|
19
|
|
20
|
private boolean hasType;
|
21
|
private List<UUID> taxonRelatedDerivedUnits = new ArrayList<>();
|
22
|
|
23
|
private GatheringEventDTO gatheringEvent;
|
24
|
|
25
|
|
26
|
/**
|
27
|
* @param fieldUnit
|
28
|
*/
|
29
|
public FieldUnitDTO(FieldUnit fieldUnit) {
|
30
|
super(fieldUnit);
|
31
|
}
|
32
|
|
33
|
|
34
|
public static FieldUnitDTO newInstance(FieldUnit fieldUnit){
|
35
|
FieldUnitDTO fieldUnitDto = new FieldUnitDTO(fieldUnit);
|
36
|
fieldUnitDto.gatheringEvent = GatheringEventDTO.newInstance(fieldUnit.getGatheringEvent());
|
37
|
fieldUnitDto.setRecordBase(fieldUnit.getRecordBasis().getMessage());
|
38
|
fieldUnitDto.setListLabel(fieldUnit.getTitleCache());
|
39
|
|
40
|
return fieldUnitDto;
|
41
|
|
42
|
}
|
43
|
|
44
|
/**
|
45
|
* @return the country
|
46
|
*/
|
47
|
public String getCountry() {
|
48
|
return country;
|
49
|
}
|
50
|
/**
|
51
|
* @param country the country to set
|
52
|
*/
|
53
|
public void setCountry(String country) {
|
54
|
this.country = country;
|
55
|
}
|
56
|
/**
|
57
|
* @return the collectionString
|
58
|
*/
|
59
|
@Override
|
60
|
public String getCollection() {
|
61
|
return collectionString;
|
62
|
}
|
63
|
/**
|
64
|
* @param collectionString the collectionString to set
|
65
|
*/
|
66
|
@Override
|
67
|
public void setCollection(String collection) {
|
68
|
this.collectionString = collection;
|
69
|
}
|
70
|
/**
|
71
|
* @return the date
|
72
|
*/
|
73
|
public String getDate() {
|
74
|
return date;
|
75
|
}
|
76
|
/**
|
77
|
* @param date the date to set
|
78
|
*/
|
79
|
public void setDate(String date) {
|
80
|
this.date = date;
|
81
|
}
|
82
|
|
83
|
|
84
|
/**
|
85
|
* @return the hasType
|
86
|
*/
|
87
|
public boolean isHasType() {
|
88
|
return hasType;
|
89
|
}
|
90
|
/**
|
91
|
* @param hasType the hasType to set
|
92
|
*/
|
93
|
public void setHasType(boolean hasType) {
|
94
|
this.hasType = hasType;
|
95
|
}
|
96
|
|
97
|
public GatheringEventDTO getGatheringEvent() {
|
98
|
return gatheringEvent;
|
99
|
}
|
100
|
public void setGatheringEvent(GatheringEventDTO gatheringEvent) {
|
101
|
this.gatheringEvent = gatheringEvent;
|
102
|
}
|
103
|
|
104
|
|
105
|
/**
|
106
|
* @return the taxonRelatedDerivedUnits
|
107
|
*/
|
108
|
public List<UUID> getTaxonRelatedDerivedUnits() {
|
109
|
return taxonRelatedDerivedUnits;
|
110
|
}
|
111
|
|
112
|
|
113
|
/**
|
114
|
* @param taxonRelatedDerivedUnits the taxonRelatedDerivedUnits to set
|
115
|
*/
|
116
|
public void setTaxonRelatedDerivedUnits(List<UUID> taxonRelatedDerivedUnits) {
|
117
|
this.taxonRelatedDerivedUnits = taxonRelatedDerivedUnits;
|
118
|
}
|
119
|
|
120
|
|
121
|
/**
|
122
|
* @param derivedUnitDTO
|
123
|
*/
|
124
|
public void addTaxonRelatedDerivedUnits(DerivateDTO derivedUnitDTO) {
|
125
|
if (this.taxonRelatedDerivedUnits == null){
|
126
|
this.taxonRelatedDerivedUnits = new ArrayList<>();
|
127
|
}
|
128
|
this.taxonRelatedDerivedUnits.add(derivedUnitDTO.getUuid());
|
129
|
|
130
|
}
|
131
|
|
132
|
}
|