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.persistence.dto;
|
10
|
|
11
|
import java.util.ArrayList;
|
12
|
import java.util.HashMap;
|
13
|
import java.util.List;
|
14
|
import java.util.Map;
|
15
|
import java.util.Map.Entry;
|
16
|
import java.util.UUID;
|
17
|
|
18
|
import eu.etaxonomy.cdm.model.common.Language;
|
19
|
import eu.etaxonomy.cdm.model.common.LanguageString;
|
20
|
import eu.etaxonomy.cdm.model.name.Rank;
|
21
|
import eu.etaxonomy.cdm.model.taxon.TaxonNodeStatus;
|
22
|
|
23
|
/**
|
24
|
* @author a.kohlbecker
|
25
|
* @since Mar 20, 2020
|
26
|
*/
|
27
|
public class SortableTaxonNodeQueryResult {
|
28
|
|
29
|
protected UUID taxonNodeUuid;
|
30
|
protected Integer taxonNodeId;
|
31
|
protected String treeIndex;
|
32
|
protected UUID taxonUuid;
|
33
|
protected String taxonTitleCache;
|
34
|
protected String nameTitleCache;
|
35
|
protected Rank nameRank = Rank.UNKNOWN_RANK();
|
36
|
protected UUID parentNodeUuid;
|
37
|
protected Integer sortIndex;
|
38
|
protected UUID classificationUuid;
|
39
|
protected Boolean taxonIsPublish = true;
|
40
|
protected TaxonNodeStatus status;
|
41
|
|
42
|
|
43
|
|
44
|
private List<LanguageString> statusNote = new ArrayList<>();
|
45
|
|
46
|
|
47
|
/**Is this the reason
|
48
|
* @param taxonNodeUuid
|
49
|
* @param taxonNodeId
|
50
|
* @param taxonTitleCache
|
51
|
* @param nameRank {@link Rank.#UNKNOWN_RANK()} will be used in case this is <code>null</code>
|
52
|
*/
|
53
|
public SortableTaxonNodeQueryResult(UUID taxonNodeUuid, Integer taxonNodeId, String treeIndex, UUID taxonUuid, String taxonTitleCache, String nameTitleCache,
|
54
|
Rank nameRank, UUID parentNodeUuid, Integer sortIndex, UUID classificationUuid, Boolean taxonIsPublished, TaxonNodeStatus status, LanguageString statusNote) {
|
55
|
this.taxonNodeUuid = taxonNodeUuid;
|
56
|
this.taxonNodeId = taxonNodeId;
|
57
|
this.treeIndex = treeIndex;
|
58
|
this.taxonUuid = taxonUuid;
|
59
|
this.taxonTitleCache = taxonTitleCache;
|
60
|
this.nameTitleCache = nameTitleCache;
|
61
|
if (nameRank != null) {
|
62
|
this.nameRank = nameRank;
|
63
|
}
|
64
|
this.parentNodeUuid = parentNodeUuid;
|
65
|
this.sortIndex = sortIndex;
|
66
|
this.classificationUuid = classificationUuid;
|
67
|
this.taxonIsPublish = taxonIsPublished;
|
68
|
this.status = status;
|
69
|
if (statusNote != null) {
|
70
|
this.statusNote.add(statusNote);
|
71
|
}
|
72
|
|
73
|
// if (statusNote != null) {
|
74
|
// this.statusNote = new HashMap<Language, String>();
|
75
|
// for (Entry<Language, LanguageString> entry :statusNote.entrySet()) {
|
76
|
// this.statusNote.put(entry.getKey(), entry.getValue().getText());
|
77
|
// }
|
78
|
// }
|
79
|
}
|
80
|
|
81
|
public SortableTaxonNodeQueryResult(UUID taxonNodeUuid, Integer taxonNodeId, String treeIndex, UUID taxonUuid, String taxonTitleCache, String nameTitleCache,
|
82
|
Rank nameRank, UUID parentNodeUuid) {
|
83
|
this(taxonNodeUuid, taxonNodeId, treeIndex, taxonUuid, taxonTitleCache, nameTitleCache, nameRank, parentNodeUuid, null, null,null, null, null);
|
84
|
}
|
85
|
/**
|
86
|
* @param taxonNodeUuid
|
87
|
* @param taxonNodeId
|
88
|
* @param taxonTitleCache
|
89
|
* @param nameRank {@link Rank.#UNKNOWN_RANK()} will be used in case this is <code>null</code>
|
90
|
*/
|
91
|
public SortableTaxonNodeQueryResult(UUID taxonNodeUuid, Integer taxonNodeId, String treeIndex, UUID taxonUuid, String taxonTitleCache,
|
92
|
Rank nameRank, UUID parentNodeUuid) {
|
93
|
this(taxonNodeUuid, taxonNodeId, treeIndex, taxonUuid, taxonTitleCache, null, nameRank, parentNodeUuid, null, null, null, null, null);
|
94
|
}
|
95
|
|
96
|
|
97
|
public SortableTaxonNodeQueryResult(UUID taxonNodeUuid, Integer taxonNodeId, String treeIndex, UUID taxonUuid, String taxonTitleCache,
|
98
|
Rank nameRank) {
|
99
|
this(taxonNodeUuid, taxonNodeId, treeIndex, taxonUuid, taxonTitleCache, null, nameRank, null, null, null, null, null, null);
|
100
|
}
|
101
|
|
102
|
public SortableTaxonNodeQueryResult(UUID taxonNodeUuid, Integer taxonNodeId, String taxonTitleCache,
|
103
|
Rank nameRank) {
|
104
|
this(taxonNodeUuid, taxonNodeId, null, null, taxonTitleCache, null, nameRank, null, null, null, null, null, null);
|
105
|
}
|
106
|
public SortableTaxonNodeQueryResult(UUID taxonNodeUuid, Integer taxonNodeId, UUID taxonUuid, String taxonTitleCache, UUID parentNodeUuid) {
|
107
|
this(taxonNodeUuid, taxonNodeId, null, taxonUuid, taxonTitleCache, null, parentNodeUuid);
|
108
|
}
|
109
|
public SortableTaxonNodeQueryResult(UUID taxonNodeUuid, Integer taxonNodeId, String taxonTitleCache, UUID parentNodeUuid) {
|
110
|
this(taxonNodeUuid, taxonNodeId, null, null, taxonTitleCache, null, parentNodeUuid);
|
111
|
}
|
112
|
|
113
|
public SortableTaxonNodeQueryResult(UUID taxonNodeUuid, Integer taxonNodeId, UUID taxonUuid, String taxonTitleCache) {
|
114
|
this(taxonNodeUuid, taxonNodeId, null, taxonUuid, taxonTitleCache, null, null);
|
115
|
}
|
116
|
public SortableTaxonNodeQueryResult(UUID taxonNodeUuid, Integer taxonNodeId, String taxonTitleCache) {
|
117
|
this(taxonNodeUuid, taxonNodeId, null, null, taxonTitleCache, null, null);
|
118
|
}
|
119
|
|
120
|
public UUID getTaxonNodeUuid() {
|
121
|
return taxonNodeUuid;
|
122
|
}
|
123
|
public void setTaxonNodeUuid(UUID taxonNodeUuid) {
|
124
|
this.taxonNodeUuid = taxonNodeUuid;
|
125
|
}
|
126
|
|
127
|
public String getTreeIndex() {
|
128
|
return treeIndex;
|
129
|
}
|
130
|
|
131
|
public void setTreeIndex(String treeIndex) {
|
132
|
this.treeIndex = treeIndex;
|
133
|
}
|
134
|
|
135
|
public Integer getSortIndex() {
|
136
|
return sortIndex;
|
137
|
}
|
138
|
|
139
|
public void setSortIndex(Integer sortIndex) {
|
140
|
this.sortIndex = sortIndex;
|
141
|
}
|
142
|
|
143
|
public UUID getTaxonUuid() {
|
144
|
return taxonUuid;
|
145
|
}
|
146
|
public void setTaxonUuid(UUID taxonUuid) {
|
147
|
this.taxonUuid = taxonUuid;
|
148
|
}
|
149
|
|
150
|
/**
|
151
|
* @return the parentNodeUuid
|
152
|
*/
|
153
|
public UUID getParentNodeUuid() {
|
154
|
return parentNodeUuid;
|
155
|
}
|
156
|
|
157
|
/**
|
158
|
* @param parentNodeUuid the parentNodeUuid to set
|
159
|
*/
|
160
|
public void setParentNodeUuid(UUID parentNodeUuid) {
|
161
|
this.parentNodeUuid = parentNodeUuid;
|
162
|
}
|
163
|
/**
|
164
|
* @return the parentNodeUuid
|
165
|
*/
|
166
|
public UUID getClassificationUuid() {
|
167
|
return classificationUuid;
|
168
|
}
|
169
|
|
170
|
/**
|
171
|
* @param parentNodeUuid the parentNodeUuid to set
|
172
|
*/
|
173
|
public void setClassificationUuid(UUID classificationUuid) {
|
174
|
this.classificationUuid = classificationUuid;
|
175
|
}
|
176
|
|
177
|
|
178
|
public boolean isTaxonIsPublish() {
|
179
|
return taxonIsPublish;
|
180
|
}
|
181
|
|
182
|
public void setTaxonIsPublish(boolean taxonIsPublish) {
|
183
|
this.taxonIsPublish = taxonIsPublish;
|
184
|
}
|
185
|
|
186
|
public List<LanguageString> getStatusNote() {
|
187
|
return statusNote;
|
188
|
}
|
189
|
|
190
|
public void setStatusNote(List<LanguageString> statusNote) {
|
191
|
this.statusNote = statusNote;
|
192
|
}
|
193
|
|
194
|
public Integer getTaxonNodeId() {
|
195
|
return taxonNodeId;
|
196
|
}
|
197
|
public void setTaxonNodeId(Integer taxonNodeId) {
|
198
|
this.taxonNodeId = taxonNodeId;
|
199
|
}
|
200
|
public String getTaxonTitleCache() {
|
201
|
return taxonTitleCache;
|
202
|
}
|
203
|
public void setTaxonTitleCache(String taxonTitleCache) {
|
204
|
this.taxonTitleCache = taxonTitleCache;
|
205
|
}
|
206
|
public Rank getNameRank() {
|
207
|
return nameRank;
|
208
|
}
|
209
|
public void setNameRank(Rank nameRank) {
|
210
|
this.nameRank = nameRank;
|
211
|
}
|
212
|
|
213
|
public String getNameTitleCache() {
|
214
|
return nameTitleCache;
|
215
|
}
|
216
|
public void setNameTitleCache(String nameTitleCache) {
|
217
|
this.nameTitleCache = nameTitleCache;
|
218
|
}
|
219
|
|
220
|
public TaxonNodeStatus getStatus() {
|
221
|
return status;
|
222
|
}
|
223
|
|
224
|
public void setStatus(TaxonNodeStatus status) {
|
225
|
this.status = status;
|
226
|
}
|
227
|
|
228
|
|
229
|
}
|