Project

General

Profile

Download (1.68 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2021 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 java.io.Serializable;
12
import java.util.UUID;
13

    
14
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
15
import eu.etaxonomy.cdm.model.description.Feature;
16
import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
17

    
18
/**
19
 * @author k.luther
20
 * @since Aug 18, 2021
21
 */
22
public class DescriptionElementDto implements Serializable {
23

    
24
    private static final long serialVersionUID = -1841517205424631763L;
25

    
26
    private FeatureDto featureDto;
27
    private UUID elementUuid;
28

    
29
    public DescriptionElementDto(FeatureDto feature){
30
        this.setFeatureDto(feature);
31
    }
32

    
33
    public DescriptionElementDto(Feature feature){
34
        this.setFeatureDto(feature);
35
    }
36

    
37
    public DescriptionElementDto(UUID elementUuid, FeatureDto feature){
38

    
39
        this.setFeatureDto(feature);
40
        setElementUuid(elementUuid);
41
    }
42

    
43
    public FeatureDto getFeatureDto() {
44
        return featureDto;
45
    }
46

    
47
    public UUID getFeatureUuid() {
48
        return featureDto.getUuid();
49
    }
50

    
51
    public void setFeatureDto(Feature feature) {
52
        feature = HibernateProxyHelper.deproxy(feature, Feature.class);
53
        this.featureDto = FeatureDto.fromFeature(feature);
54
    }
55

    
56
    public void setFeatureDto(FeatureDto feature) {
57
        this.featureDto = feature;
58
    }
59

    
60
    public UUID getElementUuid() {
61
        return elementUuid;
62
    }
63

    
64
    public void setElementUuid(UUID elementUuid) {
65
        this.elementUuid = elementUuid;
66
    }
67

    
68

    
69
}
(12-12/45)