Revision 50278
Added by Michele Artini over 6 years ago
Api.java | ||
---|---|---|
10 | 10 |
import javax.persistence.Id; |
11 | 11 |
import javax.persistence.MappedSuperclass; |
12 | 12 |
import javax.persistence.OneToMany; |
13 |
import javax.persistence.Transient; |
|
13 | 14 |
|
14 | 15 |
import com.google.common.collect.ComparisonChain; |
15 | 16 |
import com.google.gson.Gson; |
... | ... | |
30 | 31 |
protected String typology = null; |
31 | 32 |
protected String compatibility; |
32 | 33 |
|
34 |
@Transient |
|
35 |
protected boolean compatibilityOverrided = false; |
|
36 |
|
|
33 | 37 |
@Column(name = "metadata_identifier_path") |
34 | 38 |
protected String metadataIdentifierPath; |
35 | 39 |
|
... | ... | |
101 | 105 |
return compatibility; |
102 | 106 |
} |
103 | 107 |
|
108 |
public boolean isCompatibilityOverrided() { |
|
109 |
return compatibilityOverrided; |
|
110 |
} |
|
111 |
|
|
104 | 112 |
public String getMetadataIdentifierPath() { |
105 | 113 |
return metadataIdentifierPath; |
106 | 114 |
} |
... | ... | |
153 | 161 |
return apiParams; |
154 | 162 |
} |
155 | 163 |
|
156 |
public Api setId(final String id) { |
|
164 |
public Api<AP> setId(final String id) {
|
|
157 | 165 |
this.id = id; |
158 | 166 |
return this; |
159 | 167 |
} |
160 | 168 |
|
161 |
public Api setProtocol(final String protocol) { |
|
169 |
public Api<AP> setProtocol(final String protocol) {
|
|
162 | 170 |
this.protocol = protocol; |
163 | 171 |
return this; |
164 | 172 |
} |
165 | 173 |
|
166 |
public Api setDatasource(final String datasource) { |
|
174 |
public Api<AP> setDatasource(final String datasource) {
|
|
167 | 175 |
this.datasource = datasource; |
168 | 176 |
return this; |
169 | 177 |
} |
170 | 178 |
|
171 |
public Api setContentdescription(final String contentdescription) { |
|
179 |
public Api<AP> setContentdescription(final String contentdescription) {
|
|
172 | 180 |
this.contentdescription = contentdescription; |
173 | 181 |
return this; |
174 | 182 |
} |
175 | 183 |
|
176 |
public Api setActive(final Boolean active) { |
|
184 |
public Api<AP> setActive(final Boolean active) {
|
|
177 | 185 |
this.active = active; |
178 | 186 |
return this; |
179 | 187 |
} |
180 | 188 |
|
181 |
public Api setRemovable(final Boolean removable) { |
|
189 |
public Api<AP> setRemovable(final Boolean removable) {
|
|
182 | 190 |
this.removable = removable; |
183 | 191 |
return this; |
184 | 192 |
} |
185 | 193 |
|
186 |
public Api setTypology(final String typology) { |
|
194 |
public Api<AP> setTypology(final String typology) {
|
|
187 | 195 |
this.typology = typology; |
188 | 196 |
return this; |
189 | 197 |
} |
190 | 198 |
|
191 |
public Api setCompatibility(final String compatibility) { |
|
199 |
public Api<AP> setCompatibility(final String compatibility) {
|
|
192 | 200 |
this.compatibility = compatibility; |
193 | 201 |
return this; |
194 | 202 |
} |
195 | 203 |
|
196 |
public Api setMetadataIdentifierPath(final String metadataIdentifierPath) { |
|
204 |
public Api<AP> setCompatibilityOverrided(final boolean compatibilityOverrided) { |
|
205 |
this.compatibilityOverrided = compatibilityOverrided; |
|
206 |
return this; |
|
207 |
} |
|
208 |
|
|
209 |
public Api<AP> setMetadataIdentifierPath(final String metadataIdentifierPath) { |
|
197 | 210 |
this.metadataIdentifierPath = metadataIdentifierPath; |
198 | 211 |
return this; |
199 | 212 |
} |
200 | 213 |
|
201 |
public Api setLastCollectionTotal(final Integer lastCollectionTotal) { |
|
214 |
public Api<AP> setLastCollectionTotal(final Integer lastCollectionTotal) {
|
|
202 | 215 |
this.lastCollectionTotal = lastCollectionTotal; |
203 | 216 |
return this; |
204 | 217 |
} |
205 | 218 |
|
206 |
public Api setLastCollectionDate(final Date lastCollectionDate) { |
|
219 |
public Api<AP> setLastCollectionDate(final Date lastCollectionDate) {
|
|
207 | 220 |
this.lastCollectionDate = lastCollectionDate; |
208 | 221 |
return this; |
209 | 222 |
} |
210 | 223 |
|
211 |
public Api setLastCollectionMdid(final String lastCollectionMdid) { |
|
224 |
public Api<AP> setLastCollectionMdid(final String lastCollectionMdid) {
|
|
212 | 225 |
this.lastCollectionMdid = lastCollectionMdid; |
213 | 226 |
return this; |
214 | 227 |
} |
215 | 228 |
|
216 |
public Api setLastAggregationTotal(final Integer lastAggregationTotal) { |
|
229 |
public Api<AP> setLastAggregationTotal(final Integer lastAggregationTotal) {
|
|
217 | 230 |
this.lastAggregationTotal = lastAggregationTotal; |
218 | 231 |
return this; |
219 | 232 |
} |
220 | 233 |
|
221 |
public Api setLastAggregationDate(final Date lastAggregationDate) { |
|
234 |
public Api<AP> setLastAggregationDate(final Date lastAggregationDate) {
|
|
222 | 235 |
this.lastAggregationDate = lastAggregationDate; |
223 | 236 |
return this; |
224 | 237 |
} |
225 | 238 |
|
226 |
public Api setLastAggregationMdid(final String lastAggregationMdid) { |
|
239 |
public Api<AP> setLastAggregationMdid(final String lastAggregationMdid) {
|
|
227 | 240 |
this.lastAggregationMdid = lastAggregationMdid; |
228 | 241 |
return this; |
229 | 242 |
} |
230 | 243 |
|
231 |
public Api setLastDownloadTotal(final Integer lastDownloadTotal) { |
|
244 |
public Api<AP> setLastDownloadTotal(final Integer lastDownloadTotal) {
|
|
232 | 245 |
this.lastDownloadTotal = lastDownloadTotal; |
233 | 246 |
return this; |
234 | 247 |
} |
235 | 248 |
|
236 |
public Api setLastDownloadDate(final Date lastDownloadDate) { |
|
249 |
public Api<AP> setLastDownloadDate(final Date lastDownloadDate) {
|
|
237 | 250 |
this.lastDownloadDate = lastDownloadDate; |
238 | 251 |
return this; |
239 | 252 |
} |
240 | 253 |
|
241 |
public Api setLastDownloadObjid(final String lastDownloadObjid) { |
|
254 |
public Api<AP> setLastDownloadObjid(final String lastDownloadObjid) {
|
|
242 | 255 |
this.lastDownloadObjid = lastDownloadObjid; |
243 | 256 |
return this; |
244 | 257 |
} |
245 | 258 |
|
246 |
public Api setLastValidationJob(final String lastValidationJob) { |
|
259 |
public Api<AP> setLastValidationJob(final String lastValidationJob) {
|
|
247 | 260 |
this.lastValidationJob = lastValidationJob; |
248 | 261 |
return this; |
249 | 262 |
} |
250 | 263 |
|
251 |
public Api setBaseurl(final String baseurl) { |
|
264 |
public Api<AP> setBaseurl(final String baseurl) {
|
|
252 | 265 |
this.baseurl = baseurl; |
253 | 266 |
return this; |
254 | 267 |
} |
255 | 268 |
|
256 |
public Api setApiParams(final Set<AP> apiParams) { |
|
269 |
public Api<AP> setApiParams(final Set<AP> apiParams) {
|
|
257 | 270 |
this.apiParams = apiParams; |
258 | 271 |
return this; |
259 | 272 |
} |
... | ... | |
262 | 275 |
public boolean equals(final Object o) { |
263 | 276 |
if (this == o) { return true; } |
264 | 277 |
if (o == null || getClass() != o.getClass()) { return false; } |
265 |
final Api api = (Api) o;
|
|
278 |
final Api<?> api = (Api<?>) o;
|
|
266 | 279 |
return Objects.equals(this.id, api.id); |
267 | 280 |
} |
268 | 281 |
|
... | ... | |
283 | 296 |
} |
284 | 297 |
|
285 | 298 |
@Override |
286 |
public int compareTo(final Api a) { |
|
299 |
public int compareTo(final Api<AP> a) {
|
|
287 | 300 |
return ComparisonChain.start() |
288 | 301 |
.compare(getId(), a.getId()) |
289 | 302 |
.result(); |
Also available in: Unified diff
added some methods for repo UI