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