Project

General

Profile

Download (2.2 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2020 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.net.URI;
12
import java.util.UUID;
13

    
14
import eu.etaxonomy.cdm.common.DOI;
15
import eu.etaxonomy.cdm.model.common.VerbatimTimePeriod;
16
import eu.etaxonomy.cdm.model.reference.Reference;
17
import eu.etaxonomy.cdm.ref.TypedEntityReference;
18

    
19
/**
20
 * @author a.kohlbecker
21
 * @since Oct 8, 2020
22
 */
23
public class ReferenceDTO extends TypedEntityReference<Reference> {
24

    
25
    private static final long serialVersionUID = -2619569446682158500L;
26

    
27
    private String titleCache;
28
    private String abbrevTitleCache;
29
    private URI uri;
30
    private DOI doi;
31
    private VerbatimTimePeriod datePublished;
32

    
33
    public static ReferenceDTO fromReference(Reference entity) {
34
        if(entity == null) {
35
            return null;
36
        }
37
        ReferenceDTO dto = new ReferenceDTO(entity.getUuid());
38
        dto.titleCache = entity.getTitleCache();
39
        dto.abbrevTitleCache = entity.getAbbrevTitleCache();
40
        dto.uri = entity.getUri();
41
        dto.doi = entity.getDoi();
42
        dto.datePublished = entity.getDatePublished();
43

    
44
        return dto;
45
    }
46

    
47
    private ReferenceDTO(UUID uuid) {
48
        super(Reference.class, uuid);
49
    }
50

    
51
    public String getTitleCache() {
52
        return titleCache;
53
    }
54

    
55
    public void setTitleCache(String titleCache) {
56
        this.titleCache = titleCache;
57
    }
58

    
59
    public String getAbbrevTitleCache() {
60
        return abbrevTitleCache;
61
    }
62

    
63
    public void setAbbrevTitleCache(String abbrevTitleCache) {
64
        this.abbrevTitleCache = abbrevTitleCache;
65
    }
66

    
67
    public URI getUri() {
68
        return uri;
69
    }
70

    
71
    public void setUri(URI uri) {
72
        this.uri = uri;
73
    }
74

    
75
    public DOI getDoi() {
76
        return doi;
77
    }
78

    
79
    public void setDoi(DOI doi) {
80
        this.doi = doi;
81
    }
82

    
83
    public VerbatimTimePeriod getDatePublished() {
84
        return datePublished;
85
    }
86

    
87
    public void setDatePublished(VerbatimTimePeriod datePublished) {
88
        this.datePublished = datePublished;
89
    }
90

    
91
}
(20-20/36)