Project

General

Profile

Download (3.46 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2015 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.cdm.persistence.dto;
11

    
12
import java.util.Set;
13
import java.util.UUID;
14

    
15
import eu.etaxonomy.cdm.model.common.Representation;
16
import eu.etaxonomy.cdm.model.location.NamedArea;
17

    
18
/**
19
 * @author andreas
20
 * @date Mar 25, 2015
21
 *
22
 */
23
public class TermDto {
24

    
25

    
26
    private final UUID uuid;
27
    private UUID partOfUuid = null;
28
    private UUID vocabularyUuid = null;
29
    private final Set<Representation> representations;
30
    private String representation_L10n = null;
31
    private String representation_L10n_abbreviatedLabel = null;
32

    
33
    public TermDto(UUID uuid, Set<Representation> representations) {
34
        this.representations = representations;
35
        this.uuid = uuid;
36
    }
37

    
38
    public TermDto(UUID uuid, Set<Representation> representations, UUID partOfUuid, UUID vocabularyUuid) {
39
        this.representations = representations;
40
        this.uuid = uuid;
41
        this.partOfUuid = partOfUuid;
42
        this.vocabularyUuid = vocabularyUuid;
43
    }
44

    
45
    static public TermDto fromNamedArea(NamedArea namedArea) {
46
        TermDto dto = new TermDto(namedArea.getUuid(), namedArea.getRepresentations());
47
        return dto;
48
    }
49

    
50
    /**
51
     *
52
     * @param representation_L10n a blank instance of ITermRepresentation_L10n
53
     *   created by the  default constructor
54
     */
55
    public void localize(ITermRepresentation_L10n representation_L10n) {
56

    
57
        representation_L10n.localize(representations);
58
        if (representation_L10n.getLabel() != null) {
59
            setRepresentation_L10n(representation_L10n.getLabel());
60
        }
61
        if (representation_L10n.getAbbreviatedLabel() != null) {
62
            setRepresentation_L10n_abbreviatedLabel(representation_L10n.getAbbreviatedLabel());
63
        }
64
    }
65

    
66
    /**
67
     * @return the uuid
68
     */
69
    public UUID getUuid() {
70
        return uuid;
71
    }
72

    
73
    /**
74
     * @return the representation_L10n
75
     */
76
    public String getRepresentation_L10n() {
77
        return representation_L10n;
78
    }
79

    
80
    /**
81
     * @param representation_L10n the representation_L10n to set
82
     */
83
    public void setRepresentation_L10n(String representation_L10n) {
84
        this.representation_L10n = representation_L10n;
85
    }
86

    
87
    /**
88
     * @param representation_L10n_abbreviatedLabel the representation_L10n_abbreviatedLabel to set
89
     */
90
    public void setRepresentation_L10n_abbreviatedLabel(String representation_L10n_abbreviatedLabel) {
91
        this.representation_L10n_abbreviatedLabel = representation_L10n_abbreviatedLabel;
92
    }
93

    
94
    /**
95
     * @return the representation_L10n_abbreviatedLabel
96
     */
97
    public String getRepresentation_L10n_abbreviatedLabel() {
98
        return representation_L10n_abbreviatedLabel;
99
    }
100

    
101
    /**
102
     * @return the vocabularyUuid
103
     */
104
    public UUID getVocabularyUuid() {
105
        return vocabularyUuid;
106
    }
107

    
108
    /**
109
     * @param vocabularyUuid the vocabularyUuid to set
110
     */
111
    public void setVocabularyUuid(UUID vocabularyUuid) {
112
        this.vocabularyUuid = vocabularyUuid;
113
    }
114

    
115
    /**
116
     * @return the partOfUuid
117
     */
118
    public UUID getPartOfUuid() {
119
        return partOfUuid;
120
    }
121

    
122
    /**
123
     * @param representation
124
     */
125
    public void addRepresentation(Representation representation) {
126
        representations.add(representation);
127

    
128
    }
129

    
130
}
(4-4/5)