1
|
/**
|
2
|
* Copyright (C) 2018 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.api.service.dto;
|
10
|
|
11
|
import eu.etaxonomy.cdm.model.description.SpecimenDescription;
|
12
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
13
|
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
|
14
|
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
|
15
|
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
|
16
|
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
|
17
|
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
|
18
|
|
19
|
/**
|
20
|
* @author pplitzner
|
21
|
* @since 16.04.2018
|
22
|
*/
|
23
|
public class SpecimenRowWrapperDTO extends RowWrapperDTO<SpecimenDescription> {
|
24
|
|
25
|
private static final long serialVersionUID = 5198447592554976471L;
|
26
|
|
27
|
private TaxonRowWrapperDTO defaultDescription;
|
28
|
private SpecimenOrObservationBaseDTO specimenDto;
|
29
|
private UuidAndTitleCache<FieldUnit> fieldUnit;
|
30
|
private SpecimenOrObservationType type;
|
31
|
private String identifier;
|
32
|
private NamedArea country;
|
33
|
|
34
|
public SpecimenRowWrapperDTO(DescriptionBaseDto description, SpecimenOrObservationBaseDTO specimen, SpecimenOrObservationType type, TaxonNodeDto taxonNode, FieldUnit fieldUnit, String identifier,
|
35
|
NamedArea country) {
|
36
|
super(description, taxonNode);
|
37
|
if (fieldUnit != null){
|
38
|
this.fieldUnit = new UuidAndTitleCache<>(fieldUnit.getUuid(), fieldUnit.getId(), fieldUnit.getTitleCache());
|
39
|
}
|
40
|
this.identifier = identifier;
|
41
|
this.country = country;
|
42
|
this.specimenDto = specimen;
|
43
|
this.type = type;
|
44
|
}
|
45
|
|
46
|
|
47
|
public SpecimenRowWrapperDTO(SpecimenOrObservationBase specimen, TaxonNodeDto taxonNode, FieldUnit fieldUnit, String identifier,
|
48
|
NamedArea country) {
|
49
|
super(new DescriptionBaseDto(new UuidAndTitleCache<SpecimenOrObservationBase>(specimen.getUuid(), specimen.getId(), specimen.getTitleCache())), taxonNode);
|
50
|
if (fieldUnit != null){
|
51
|
this.fieldUnit = new UuidAndTitleCache<>(fieldUnit.getUuid(), fieldUnit.getId(), fieldUnit.getTitleCache());
|
52
|
}
|
53
|
this.identifier = identifier;
|
54
|
this.country = country;
|
55
|
this.specimenDto = SpecimenOrObservationDTOFactory.fromEntity(specimen);
|
56
|
this.type = specimen.getRecordBasis();
|
57
|
}
|
58
|
|
59
|
public SpecimenRowWrapperDTO(SpecimenOrObservationBase specimen, TaxonNodeDto taxonNode, UuidAndTitleCache<FieldUnit> fieldUnit, String identifier,
|
60
|
NamedArea country) {
|
61
|
super(new DescriptionBaseDto(new UuidAndTitleCache<SpecimenOrObservationBase>(specimen.getUuid(), specimen.getId(), specimen.getTitleCache())), taxonNode);
|
62
|
if (fieldUnit != null){
|
63
|
this.fieldUnit = fieldUnit;
|
64
|
}
|
65
|
this.identifier = identifier;
|
66
|
this.country = country;
|
67
|
this.specimenDto = SpecimenOrObservationDTOFactory.fromEntity(specimen);
|
68
|
this.type = specimen.getRecordBasis();
|
69
|
|
70
|
}
|
71
|
public SpecimenOrObservationBaseDTO getSpecimenDto() {
|
72
|
return specimenDto;
|
73
|
}
|
74
|
|
75
|
public UuidAndTitleCache<FieldUnit> getFieldUnit() {
|
76
|
return fieldUnit;
|
77
|
}
|
78
|
|
79
|
public String getIdentifier() {
|
80
|
return identifier;
|
81
|
}
|
82
|
|
83
|
public NamedArea getCountry() {
|
84
|
return country;
|
85
|
}
|
86
|
|
87
|
public TaxonRowWrapperDTO getDefaultDescription() {
|
88
|
return defaultDescription;
|
89
|
}
|
90
|
public void setDefaultDescription(TaxonRowWrapperDTO defaultDescription) {
|
91
|
this.defaultDescription = defaultDescription;
|
92
|
}
|
93
|
|
94
|
public SpecimenOrObservationType getType(){
|
95
|
return type;
|
96
|
}
|
97
|
}
|