ref #8369 SpecimenTypeDesignationDTO: adding missing getters and basing on TypedEntit...
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / dto / FieldUnitDTO.java
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 collectingString;
18 private String date;
19 private String collectionString;
20
21 private boolean hasType;
22 private List<UUID> taxonRelatedDerivedUnits = new ArrayList<>();
23
24 private GatheringEventDTO gatheringEvent;
25
26
27 /**
28 * @param fieldUnit
29 */
30 public FieldUnitDTO(FieldUnit fieldUnit) {
31 super(fieldUnit);
32 }
33
34
35 public static FieldUnitDTO newInstance(FieldUnit fieldUnit){
36 FieldUnitDTO fieldUnitDto = new FieldUnitDTO(fieldUnit);
37 if (fieldUnit.getGatheringEvent() != null){
38 fieldUnitDto.gatheringEvent = GatheringEventDTO.newInstance(fieldUnit.getGatheringEvent());
39 }
40 fieldUnitDto.setRecordBase(fieldUnit.getRecordBasis().getMessage());
41 fieldUnitDto.setListLabel(fieldUnit.getTitleCache());
42
43 return fieldUnitDto;
44
45 }
46
47 /**
48 * @return the country
49 */
50 public String getCountry() {
51 return country;
52 }
53 /**
54 * @param country the country to set
55 */
56 public void setCountry(String country) {
57 this.country = country;
58 }
59 /**
60 * @return the collectionString
61 */
62 @Override
63 public String getCollection() {
64 return collectionString;
65 }
66 /**
67 * @param collectionString the collectionString to set
68 */
69 @Override
70 public void setCollection(String collection) {
71 this.collectionString = collection;
72 }
73
74 /**
75 * @return the collectionString
76 */
77
78 public String getCollectingString() {
79 return collectingString;
80 }
81 /**
82 * @param collectionString the collectionString to set
83 */
84 public void setCollectingString(String collectingString) {
85 this.collectingString = collectingString;
86 }
87
88 /**
89 * @return the date
90 */
91 public String getDate() {
92 return date;
93 }
94 /**
95 * @param date the date to set
96 */
97 public void setDate(String date) {
98 this.date = date;
99 }
100
101
102 /**
103 * @return the hasType
104 */
105 public boolean isHasType() {
106 return hasType;
107 }
108 /**
109 * @param hasType the hasType to set
110 */
111 public void setHasType(boolean hasType) {
112 this.hasType = hasType;
113 }
114
115 public GatheringEventDTO getGatheringEvent() {
116 return gatheringEvent;
117 }
118 public void setGatheringEvent(GatheringEventDTO gatheringEvent) {
119 this.gatheringEvent = gatheringEvent;
120 }
121
122
123 /**
124 * @return the taxonRelatedDerivedUnits
125 */
126 public List<UUID> getTaxonRelatedDerivedUnits() {
127 return taxonRelatedDerivedUnits;
128 }
129
130
131 /**
132 * @param taxonRelatedDerivedUnits the taxonRelatedDerivedUnits to set
133 */
134 public void setTaxonRelatedDerivedUnits(List<UUID> taxonRelatedDerivedUnits) {
135 this.taxonRelatedDerivedUnits = taxonRelatedDerivedUnits;
136 }
137
138
139 /**
140 * @param derivedUnitDTO
141 */
142 public void addTaxonRelatedDerivedUnits(DerivateDTO derivedUnitDTO) {
143 if (this.taxonRelatedDerivedUnits == null){
144 this.taxonRelatedDerivedUnits = new ArrayList<>();
145 }
146 this.taxonRelatedDerivedUnits.add(derivedUnitDTO.getUuid());
147
148 }
149
150 }