Project

General

Profile

Download (1.6 KB) Statistics
| Branch: | Tag: | Revision:
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.vaadin.model;
10

    
11
import java.io.Serializable;
12
import java.util.UUID;
13

    
14
import org.joda.time.DateTime;
15

    
16
import eu.etaxonomy.cdm.model.common.CdmBase;
17
import eu.etaxonomy.cdm.model.permission.User;
18

    
19
/**
20
 * A DTO for cdm entities which itself implements the
21
 * <a href="https://en.wikipedia.org/wiki/Adapter_pattern#Object_Adapter_pattern">Object Adaptor Pattern</a>.
22
 *
23
 *
24
 * @author a.kohlbecker
25
 * @since Apr 23, 2018
26
 *
27
 */
28
public class CdmEntityAdapterDTO<CDM extends CdmBase> implements Serializable {
29

    
30
    private static final long serialVersionUID = 1715911851453178727L;
31

    
32
    protected CDM entity;
33

    
34
    public CdmEntityAdapterDTO(CDM entity){
35
        this.entity = entity;
36
    }
37

    
38
    public CDM cdmEntity(){
39
        return entity;
40
    }
41

    
42
    public void setCreated(DateTime created) {
43
        entity.setCreated(created);
44
    }
45

    
46
    public void setCreatedBy(User createdBy) {
47
        entity.setCreatedBy(createdBy);
48
    }
49

    
50
    public DateTime getCreated() {
51
        return entity.getCreated();
52
    }
53

    
54
    public User getCreatedBy() {
55
        return entity.getCreatedBy();
56
    }
57

    
58
    public int getId() {
59
        return entity.getId();
60
    }
61

    
62
    public void setId(int id) {
63
        entity.setId(id);
64
    }
65

    
66
    public UUID getUuid() {
67
        return entity.getUuid();
68
    }
69

    
70
    public void setUuid(UUID uuid) {
71
        entity.setUuid(uuid);
72
    }
73

    
74
}
(1-1/5)