1
|
package eu.dnetlib.domain.functionality;
|
2
|
|
3
|
import java.util.ArrayList;
|
4
|
import java.util.Date;
|
5
|
import java.util.HashSet;
|
6
|
import java.util.List;
|
7
|
import java.util.Set;
|
8
|
|
9
|
import eu.dnetlib.domain.DriverResource;
|
10
|
|
11
|
/**
|
12
|
*
|
13
|
* The domain object for the Collection resource data structure
|
14
|
*
|
15
|
*/
|
16
|
public class Collection extends DriverResource {
|
17
|
private static final long serialVersionUID = 6325631170397780724L;
|
18
|
|
19
|
private String Name = null; // +
|
20
|
private String Owner = null; // +
|
21
|
private String Father = null; // -
|
22
|
private List<String> description = new ArrayList<String>(); // +
|
23
|
private String Subject = null; // -
|
24
|
private boolean Private = true;
|
25
|
private boolean Visible = false;
|
26
|
private boolean Container = false;
|
27
|
private Set<String> Children = new HashSet<String>(); // -
|
28
|
private String Query = null; // + (timi an container = false)
|
29
|
private int DocumentCount = 0;
|
30
|
private Date LastUpdateDate = null; // -
|
31
|
private boolean Frozen = false;
|
32
|
private String iconUrl = null; // -
|
33
|
private String retrievalCondition = null;
|
34
|
private List<String> documentsInBasket = new ArrayList<String>();
|
35
|
|
36
|
public String getRetrievalCondition() {
|
37
|
return retrievalCondition;
|
38
|
}
|
39
|
|
40
|
public void setRetrievalCondition(String retrievalCondition) {
|
41
|
this.retrievalCondition = retrievalCondition;
|
42
|
}
|
43
|
|
44
|
/**
|
45
|
* The default constructor sets the resourceKind to <b>CollectionDSResources</b>,
|
46
|
* resourceType to <b>CollectionDSResourceType</b> and dateOfCreation to the current system date.
|
47
|
*/
|
48
|
public Collection() {
|
49
|
this.setResourceKind("CollectionDSResources");
|
50
|
this.setResourceType("CollectionDSResourceType");
|
51
|
this.setDateOfCreation(new Date());
|
52
|
}
|
53
|
|
54
|
@Deprecated
|
55
|
public String getId() {
|
56
|
return this.getResourceId();
|
57
|
}
|
58
|
@Deprecated
|
59
|
public void setId(String id) {
|
60
|
this.setResourceId(id);
|
61
|
}
|
62
|
public String getIconUrl() {
|
63
|
return iconUrl;
|
64
|
}
|
65
|
public void setIconUrl(String iconUrl) {
|
66
|
this.iconUrl = iconUrl;
|
67
|
}
|
68
|
public Set<String> getChildren() {
|
69
|
return Children;
|
70
|
}
|
71
|
public void setChildren(Set<String> children) {
|
72
|
Children = children;
|
73
|
}
|
74
|
public boolean isContainer() {
|
75
|
return Container;
|
76
|
}
|
77
|
public void setContainer(boolean container) {
|
78
|
Container = container;
|
79
|
}
|
80
|
public int getDocumentCount() {
|
81
|
return DocumentCount;
|
82
|
}
|
83
|
public void setDocumentCount(int documentCount) {
|
84
|
DocumentCount = documentCount;
|
85
|
}
|
86
|
public String getFather() {
|
87
|
return Father;
|
88
|
}
|
89
|
public void setFather(String father) {
|
90
|
Father = father;
|
91
|
}
|
92
|
public boolean isFrozen() {
|
93
|
return Frozen;
|
94
|
}
|
95
|
public void setFrozen(boolean frozen) {
|
96
|
Frozen = frozen;
|
97
|
}
|
98
|
public Date getLastUpdateDate() {
|
99
|
return LastUpdateDate;
|
100
|
}
|
101
|
public void setLastUpdateDate(Date lastUpdateDate) {
|
102
|
LastUpdateDate = lastUpdateDate;
|
103
|
}
|
104
|
public String getName() {
|
105
|
return Name;
|
106
|
}
|
107
|
public void setName(String name) {
|
108
|
Name = name;
|
109
|
}
|
110
|
public String getOwner() {
|
111
|
return Owner;
|
112
|
}
|
113
|
public void setOwner(String owner) {
|
114
|
Owner = owner;
|
115
|
}
|
116
|
public boolean isPrivate() {
|
117
|
return Private;
|
118
|
}
|
119
|
public void setPrivate(boolean private1) {
|
120
|
Private = private1;
|
121
|
}
|
122
|
public String getQuery() {
|
123
|
return Query;
|
124
|
}
|
125
|
public void setQuery(String query) {
|
126
|
Query = query;
|
127
|
}
|
128
|
public String getSubject() {
|
129
|
return Subject;
|
130
|
}
|
131
|
public void setSubject(String subject) {
|
132
|
Subject = subject;
|
133
|
}
|
134
|
public boolean isVisible() {
|
135
|
return Visible;
|
136
|
}
|
137
|
public void setVisible(boolean visible) {
|
138
|
Visible = visible;
|
139
|
}
|
140
|
public List<String> getDescription() {
|
141
|
return description;
|
142
|
}
|
143
|
public void setDescription(List<String> description) {
|
144
|
this.description = description;
|
145
|
}
|
146
|
|
147
|
public List<String> getDocumentsInBasket() {
|
148
|
return documentsInBasket;
|
149
|
}
|
150
|
|
151
|
public void setDocumentsInBasket(List<String> documentsInBasket) {
|
152
|
this.documentsInBasket = documentsInBasket;
|
153
|
}
|
154
|
|
155
|
@Override
|
156
|
public int hashCode() {
|
157
|
final int prime = 31;
|
158
|
int result = super.hashCode();
|
159
|
result = prime * result
|
160
|
+ ((Children == null) ? 0 : Children.hashCode());
|
161
|
result = prime * result + (Container ? 1231 : 1237);
|
162
|
result = prime * result + DocumentCount;
|
163
|
result = prime * result + ((Father == null) ? 0 : Father.hashCode());
|
164
|
result = prime * result + (Frozen ? 1231 : 1237);
|
165
|
result = prime * result
|
166
|
+ ((LastUpdateDate == null) ? 0 : LastUpdateDate.hashCode());
|
167
|
result = prime * result + ((Name == null) ? 0 : Name.hashCode());
|
168
|
result = prime * result + ((Owner == null) ? 0 : Owner.hashCode());
|
169
|
result = prime * result + (Private ? 1231 : 1237);
|
170
|
result = prime * result + ((Query == null) ? 0 : Query.hashCode());
|
171
|
result = prime * result + ((Subject == null) ? 0 : Subject.hashCode());
|
172
|
result = prime * result + (Visible ? 1231 : 1237);
|
173
|
result = prime * result
|
174
|
+ ((description == null) ? 0 : description.hashCode());
|
175
|
result = prime * result + ((iconUrl == null) ? 0 : iconUrl.hashCode());
|
176
|
result = prime
|
177
|
* result
|
178
|
+ ((retrievalCondition == null) ? 0 : retrievalCondition
|
179
|
.hashCode());
|
180
|
return result;
|
181
|
}
|
182
|
|
183
|
@Override
|
184
|
public boolean equals(Object obj) {
|
185
|
if (this == obj)
|
186
|
return true;
|
187
|
if (!super.equals(obj))
|
188
|
return false;
|
189
|
if (getClass() != obj.getClass())
|
190
|
return false;
|
191
|
Collection other = (Collection) obj;
|
192
|
if (Children == null) {
|
193
|
if (other.Children != null)
|
194
|
return false;
|
195
|
} else if (!Children.equals(other.Children))
|
196
|
return false;
|
197
|
if (Container != other.Container)
|
198
|
return false;
|
199
|
if (DocumentCount != other.DocumentCount)
|
200
|
return false;
|
201
|
if (Father == null) {
|
202
|
if (other.Father != null)
|
203
|
return false;
|
204
|
} else if (!Father.equals(other.Father))
|
205
|
return false;
|
206
|
if (Frozen != other.Frozen)
|
207
|
return false;
|
208
|
if (LastUpdateDate == null) {
|
209
|
if (other.LastUpdateDate != null)
|
210
|
return false;
|
211
|
} else if (!LastUpdateDate.equals(other.LastUpdateDate))
|
212
|
return false;
|
213
|
if (Name == null) {
|
214
|
if (other.Name != null)
|
215
|
return false;
|
216
|
} else if (!Name.equals(other.Name))
|
217
|
return false;
|
218
|
if (Owner == null) {
|
219
|
if (other.Owner != null)
|
220
|
return false;
|
221
|
} else if (!Owner.equals(other.Owner))
|
222
|
return false;
|
223
|
if (Private != other.Private)
|
224
|
return false;
|
225
|
if (Query == null) {
|
226
|
if (other.Query != null)
|
227
|
return false;
|
228
|
} else if (!Query.equals(other.Query))
|
229
|
return false;
|
230
|
if (Subject == null) {
|
231
|
if (other.Subject != null)
|
232
|
return false;
|
233
|
} else if (!Subject.equals(other.Subject))
|
234
|
return false;
|
235
|
if (Visible != other.Visible)
|
236
|
return false;
|
237
|
if (description == null) {
|
238
|
if (other.description != null)
|
239
|
return false;
|
240
|
} else if (!description.equals(other.description))
|
241
|
return false;
|
242
|
if (iconUrl == null) {
|
243
|
if (other.iconUrl != null)
|
244
|
return false;
|
245
|
} else if (!iconUrl.equals(other.iconUrl))
|
246
|
return false;
|
247
|
if (retrievalCondition == null) {
|
248
|
if (other.retrievalCondition != null)
|
249
|
return false;
|
250
|
} else if (!retrievalCondition.equals(other.retrievalCondition))
|
251
|
return false;
|
252
|
return true;
|
253
|
}
|
254
|
}
|