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.api.service.dto;
|
10
|
|
11
|
import java.io.Serializable;
|
12
|
import java.net.URI;
|
13
|
import java.util.ArrayList;
|
14
|
import java.util.List;
|
15
|
import java.util.UUID;
|
16
|
|
17
|
/**
|
18
|
* @author pplitzner
|
19
|
* @since Mar 26, 2015
|
20
|
*
|
21
|
*/
|
22
|
public class DerivateDataDTO implements Serializable {
|
23
|
|
24
|
private static final long serialVersionUID = 8329871164348514709L;
|
25
|
|
26
|
private List<Link> specimenScans;
|
27
|
private List<MolecularData> molecularDataList;
|
28
|
private List<Link> detailImages;
|
29
|
private List<UUID> specimenScanUuids;
|
30
|
private List<UUID> detailImageUuids;
|
31
|
|
32
|
/**
|
33
|
* @return the molecularData
|
34
|
*/
|
35
|
public List<MolecularData> getMolecularDataList() {
|
36
|
return molecularDataList;
|
37
|
}
|
38
|
|
39
|
public MolecularData addProviderLink(Link providerLink) {
|
40
|
if(this.molecularDataList==null){
|
41
|
molecularDataList = new ArrayList<MolecularData>();
|
42
|
}
|
43
|
MolecularData molecularData = new MolecularData(providerLink);
|
44
|
this.molecularDataList.add(molecularData);
|
45
|
return molecularData;
|
46
|
}
|
47
|
|
48
|
/**
|
49
|
* @return the specimenScans
|
50
|
*/
|
51
|
public List<Link> getSpecimenScans() {
|
52
|
return specimenScans;
|
53
|
}
|
54
|
|
55
|
public void addSpecimenScan(URI uri, String linkText){
|
56
|
if(specimenScans==null){
|
57
|
specimenScans = new ArrayList<Link>();
|
58
|
}
|
59
|
specimenScans.add(new Link(uri, linkText));
|
60
|
}
|
61
|
|
62
|
/**
|
63
|
* @return the detailImages
|
64
|
*/
|
65
|
public List<Link> getDetailImages() {
|
66
|
return detailImages;
|
67
|
}
|
68
|
|
69
|
public void addDetailImage(URI uri, String motif){
|
70
|
if(detailImages==null){
|
71
|
detailImages = new ArrayList<Link>();
|
72
|
}
|
73
|
detailImages.add(new Link(uri, motif));
|
74
|
}
|
75
|
|
76
|
/**
|
77
|
* @return the specimenScanUuids
|
78
|
*/
|
79
|
public List<UUID> getSpecimenScanUuids() {
|
80
|
return specimenScanUuids;
|
81
|
}
|
82
|
|
83
|
public void addSpecimenScanUuid(UUID uuid){
|
84
|
if(specimenScanUuids==null){
|
85
|
specimenScanUuids = new ArrayList<UUID>();
|
86
|
}
|
87
|
specimenScanUuids.add(uuid);
|
88
|
}
|
89
|
|
90
|
/**
|
91
|
* @return the detailImageUuids
|
92
|
*/
|
93
|
public List<UUID> getDetailImageUuids() {
|
94
|
return detailImageUuids;
|
95
|
}
|
96
|
|
97
|
public void addDetailImageUuid(UUID uuid){
|
98
|
if(detailImageUuids==null){
|
99
|
detailImageUuids = new ArrayList<UUID>();
|
100
|
}
|
101
|
detailImageUuids.add(uuid);
|
102
|
}
|
103
|
|
104
|
public class MolecularData implements Serializable{
|
105
|
|
106
|
private static final long serialVersionUID = -3509828381796659200L;
|
107
|
|
108
|
private final Link providerLink;
|
109
|
private List<ContigFile> contigFiles;
|
110
|
|
111
|
public MolecularData(Link providerLink) {
|
112
|
super();
|
113
|
this.providerLink = providerLink;
|
114
|
}
|
115
|
|
116
|
public ContigFile addContigFile(Link contigLink){
|
117
|
if(contigFiles==null){
|
118
|
contigFiles = new ArrayList<ContigFile>();
|
119
|
}
|
120
|
ContigFile contigFile = new ContigFile(contigLink);
|
121
|
contigFiles.add(contigFile);
|
122
|
return contigFile;
|
123
|
}
|
124
|
|
125
|
public synchronized Link getProviderLink() {
|
126
|
return providerLink;
|
127
|
}
|
128
|
|
129
|
public List<ContigFile> getContigFiles() {
|
130
|
return contigFiles;
|
131
|
}
|
132
|
|
133
|
}
|
134
|
|
135
|
public class ContigFile implements Serializable{
|
136
|
|
137
|
private final Link contigLink;
|
138
|
private List<Link> primerLinks;
|
139
|
|
140
|
public ContigFile(Link contigLink) {
|
141
|
this.contigLink = contigLink;
|
142
|
}
|
143
|
|
144
|
public void addPrimerLink(URI uri, String linkText){
|
145
|
if(primerLinks==null){
|
146
|
primerLinks = new ArrayList<Link>();
|
147
|
}
|
148
|
primerLinks.add(new Link(uri, linkText));
|
149
|
}
|
150
|
|
151
|
public Link getContigLink() {
|
152
|
return contigLink;
|
153
|
}
|
154
|
|
155
|
public List<Link> getPrimerLinks() {
|
156
|
return primerLinks;
|
157
|
}
|
158
|
|
159
|
}
|
160
|
|
161
|
public static class Link implements Serializable{
|
162
|
|
163
|
private static final long serialVersionUID = 6635385359662624579L;
|
164
|
|
165
|
private String linkText;
|
166
|
private URI uri;
|
167
|
|
168
|
public Link(URI uri, String linkText) {
|
169
|
super();
|
170
|
this.linkText = linkText;
|
171
|
this.uri = uri;
|
172
|
}
|
173
|
/**
|
174
|
* @return the linkText
|
175
|
*/
|
176
|
public synchronized String getLinkText() {
|
177
|
return linkText;
|
178
|
}
|
179
|
/**
|
180
|
* @param linkText the linkText to set
|
181
|
*/
|
182
|
public synchronized void setLinkText(String linkText) {
|
183
|
this.linkText = linkText;
|
184
|
}
|
185
|
/**
|
186
|
* @return the uri
|
187
|
*/
|
188
|
public synchronized URI getUri() {
|
189
|
return uri;
|
190
|
}
|
191
|
/**
|
192
|
* @param uri the uri to set
|
193
|
*/
|
194
|
public synchronized void setUri(URI uri) {
|
195
|
this.uri = uri;
|
196
|
}
|
197
|
/* (non-Javadoc)
|
198
|
* @see java.lang.Object#hashCode()
|
199
|
*/
|
200
|
@Override
|
201
|
public int hashCode() {
|
202
|
final int prime = 31;
|
203
|
int result = 1;
|
204
|
result = prime * result + ((linkText == null) ? 0 : linkText.hashCode());
|
205
|
result = prime * result + ((uri == null) ? 0 : uri.hashCode());
|
206
|
return result;
|
207
|
}
|
208
|
/* (non-Javadoc)
|
209
|
* @see java.lang.Object#equals(java.lang.Object)
|
210
|
*/
|
211
|
@Override
|
212
|
public boolean equals(Object obj) {
|
213
|
if (this == obj) {
|
214
|
return true;
|
215
|
}
|
216
|
if (obj == null) {
|
217
|
return false;
|
218
|
}
|
219
|
if (getClass() != obj.getClass()) {
|
220
|
return false;
|
221
|
}
|
222
|
Link other = (Link) obj;
|
223
|
if (linkText == null) {
|
224
|
if (other.linkText != null) {
|
225
|
return false;
|
226
|
}
|
227
|
} else if (!linkText.equals(other.linkText)) {
|
228
|
return false;
|
229
|
}
|
230
|
if (uri == null) {
|
231
|
if (other.uri != null) {
|
232
|
return false;
|
233
|
}
|
234
|
} else if (!uri.equals(other.uri)) {
|
235
|
return false;
|
236
|
}
|
237
|
return true;
|
238
|
}
|
239
|
}
|
240
|
|
241
|
|
242
|
}
|