1
|
/**
|
2
|
* Copyright (C) 2015 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.persistence.dto;
|
10
|
|
11
|
import java.util.Set;
|
12
|
import java.util.UUID;
|
13
|
|
14
|
import eu.etaxonomy.cdm.model.common.Representation;
|
15
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
16
|
|
17
|
/**
|
18
|
* @author andreas
|
19
|
* @date Mar 25, 2015
|
20
|
*
|
21
|
*/
|
22
|
public class TermDto {
|
23
|
|
24
|
|
25
|
private final UUID uuid;
|
26
|
private UUID partOfUuid = null;
|
27
|
private UUID vocabularyUuid = null;
|
28
|
private Integer orderIndex = 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, Integer orderIndex) {
|
34
|
this.representations = representations;
|
35
|
this.uuid = uuid;
|
36
|
this.setOrderIndex(orderIndex);
|
37
|
}
|
38
|
|
39
|
public TermDto(UUID uuid, Set<Representation> representations, UUID partOfUuid, UUID vocabularyUuid, Integer orderIndex) {
|
40
|
this.representations = representations;
|
41
|
this.uuid = uuid;
|
42
|
this.partOfUuid = partOfUuid;
|
43
|
this.vocabularyUuid = vocabularyUuid;
|
44
|
this.setOrderIndex(orderIndex);
|
45
|
}
|
46
|
|
47
|
static public TermDto fromNamedArea(NamedArea namedArea) {
|
48
|
TermDto dto = new TermDto(namedArea.getUuid(), namedArea.getRepresentations(), namedArea.getOrderIndex());
|
49
|
return dto;
|
50
|
}
|
51
|
|
52
|
/**
|
53
|
*
|
54
|
* @param representation_L10n a blank instance of ITermRepresentation_L10n
|
55
|
* created by the default constructor
|
56
|
*/
|
57
|
public void localize(ITermRepresentation_L10n representation_L10n) {
|
58
|
|
59
|
representation_L10n.localize(representations);
|
60
|
if (representation_L10n.getLabel() != null) {
|
61
|
setRepresentation_L10n(representation_L10n.getLabel());
|
62
|
}
|
63
|
if (representation_L10n.getAbbreviatedLabel() != null) {
|
64
|
setRepresentation_L10n_abbreviatedLabel(representation_L10n.getAbbreviatedLabel());
|
65
|
}
|
66
|
}
|
67
|
|
68
|
/**
|
69
|
* @return the uuid
|
70
|
*/
|
71
|
public UUID getUuid() {
|
72
|
return uuid;
|
73
|
}
|
74
|
|
75
|
/**
|
76
|
* @return the representation_L10n
|
77
|
*/
|
78
|
public String getRepresentation_L10n() {
|
79
|
return representation_L10n;
|
80
|
}
|
81
|
|
82
|
/**
|
83
|
* @param representation_L10n the representation_L10n to set
|
84
|
*/
|
85
|
public void setRepresentation_L10n(String representation_L10n) {
|
86
|
this.representation_L10n = representation_L10n;
|
87
|
}
|
88
|
|
89
|
/**
|
90
|
* @param representation_L10n_abbreviatedLabel the representation_L10n_abbreviatedLabel to set
|
91
|
*/
|
92
|
public void setRepresentation_L10n_abbreviatedLabel(String representation_L10n_abbreviatedLabel) {
|
93
|
this.representation_L10n_abbreviatedLabel = representation_L10n_abbreviatedLabel;
|
94
|
}
|
95
|
|
96
|
/**
|
97
|
* @return the representation_L10n_abbreviatedLabel
|
98
|
*/
|
99
|
public String getRepresentation_L10n_abbreviatedLabel() {
|
100
|
return representation_L10n_abbreviatedLabel;
|
101
|
}
|
102
|
|
103
|
/**
|
104
|
* @return the vocabularyUuid
|
105
|
*/
|
106
|
public UUID getVocabularyUuid() {
|
107
|
return vocabularyUuid;
|
108
|
}
|
109
|
|
110
|
/**
|
111
|
* @param vocabularyUuid the vocabularyUuid to set
|
112
|
*/
|
113
|
public void setVocabularyUuid(UUID vocabularyUuid) {
|
114
|
this.vocabularyUuid = vocabularyUuid;
|
115
|
}
|
116
|
|
117
|
/**
|
118
|
* @return the partOfUuid
|
119
|
*/
|
120
|
public UUID getPartOfUuid() {
|
121
|
return partOfUuid;
|
122
|
}
|
123
|
|
124
|
/**
|
125
|
* @param representation
|
126
|
*/
|
127
|
public void addRepresentation(Representation representation) {
|
128
|
representations.add(representation);
|
129
|
|
130
|
}
|
131
|
|
132
|
/**
|
133
|
* @return the orderIndex
|
134
|
*/
|
135
|
public Integer getOrderIndex() {
|
136
|
return orderIndex;
|
137
|
}
|
138
|
|
139
|
/**
|
140
|
* @param orderIndex the orderIndex to set
|
141
|
*/
|
142
|
public void setOrderIndex(Integer orderIndex) {
|
143
|
this.orderIndex = orderIndex;
|
144
|
}
|
145
|
|
146
|
|
147
|
|
148
|
}
|