1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.sourceforge.javadpkg.control.impl;
20
21 import java.util.ArrayList;
22 import java.util.LinkedList;
23 import java.util.List;
24
25 import net.sourceforge.javadpkg.control.Architecture;
26 import net.sourceforge.javadpkg.control.BinaryControl;
27 import net.sourceforge.javadpkg.control.Description;
28 import net.sourceforge.javadpkg.control.Homepage;
29 import net.sourceforge.javadpkg.control.PackageDependency;
30 import net.sourceforge.javadpkg.control.PackageMaintainer;
31 import net.sourceforge.javadpkg.control.PackageMultiArchitecture;
32 import net.sourceforge.javadpkg.control.PackageName;
33 import net.sourceforge.javadpkg.control.PackagePriority;
34 import net.sourceforge.javadpkg.control.PackageVersion;
35 import net.sourceforge.javadpkg.control.Section;
36 import net.sourceforge.javadpkg.control.Size;
37
38
39
40
41
42
43
44
45
46
47 public class BinaryControlImpl extends AbstractControl implements BinaryControl {
48
49
50
51 private PackageName packageName;
52
53 private Section section;
54
55 private PackagePriority priority;
56
57
58
59
60
61 private Boolean essential;
62
63 private List<PackageDependency> depends;
64
65
66
67
68
69
70 private List<PackageDependency> recommends;
71
72
73
74
75
76
77 private List<PackageDependency> suggest;
78
79
80
81
82
83 private List<PackageDependency> enhances;
84
85
86
87
88
89 private List<PackageDependency> preDepends;
90
91 private List<PackageDependency> breaks;
92
93 private List<PackageDependency> conflicts;
94
95 private List<PackageDependency> provides;
96
97 private List<PackageDependency> replaces;
98
99 private List<PackageDependency> builtUsing;
100
101
102
103
104
105
106 private Size installedSize;
107
108 private String moduleAliases;
109
110 private Description description;
111
112
113
114
115
116
117
118 public BinaryControlImpl() {
119 super();
120
121 this.packageName = null;
122 this.section = null;
123 this.priority = null;
124 this.essential = null;
125 this.depends = new LinkedList<>();
126 this.recommends = new LinkedList<>();
127 this.suggest = new LinkedList<>();
128 this.enhances = new LinkedList<>();
129 this.preDepends = new LinkedList<>();
130 this.breaks = new LinkedList<>();
131 this.conflicts = new LinkedList<>();
132 this.provides = new LinkedList<>();
133 this.replaces = new LinkedList<>();
134 this.builtUsing = new LinkedList<>();
135 this.installedSize = null;
136 this.moduleAliases = null;
137 this.description = null;
138 }
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197 public BinaryControlImpl(PackageDependency source, PackageVersion version, Architecture architecture,
198 PackageMultiArchitecture multiArchitecture, PackageMaintainer maintainer, Homepage homepage,
199 PackageName packageName, Section section, PackagePriority priority, Boolean essential,
200 List<PackageDependency> depends, List<PackageDependency> recommends, List<PackageDependency> suggest,
201 List<PackageDependency> enhances, List<PackageDependency> preDepends, List<PackageDependency> breaks,
202 List<PackageDependency> conflicts, List<PackageDependency> provides, List<PackageDependency> replaces,
203 List<PackageDependency> builtUsing, Size installedSize, Description description) {
204
205 super(source, version, architecture, multiArchitecture, maintainer, homepage);
206
207 this.packageName = packageName;
208 this.section = section;
209 this.priority = priority;
210 this.essential = essential;
211 this.depends = getList(depends);
212 this.recommends = getList(recommends);
213 this.suggest = getList(suggest);
214 this.enhances = getList(enhances);
215 this.preDepends = getList(preDepends);
216 this.breaks = getList(breaks);
217 this.conflicts = getList(conflicts);
218 this.provides = getList(provides);
219 this.replaces = getList(replaces);
220 this.builtUsing = getList(builtUsing);
221 this.installedSize = null;
222 this.description = null;
223 }
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239 private static <T> List<T> getList(List<T> list) {
240 if (list == null)
241 return new LinkedList<>();
242 return (new LinkedList<>(list));
243 }
244
245
246 @Override
247 public PackageName getPackage() {
248 return this.packageName;
249 }
250
251
252
253
254
255
256
257
258
259
260 public void setPackage(PackageName packageName) {
261 this.packageName = packageName;
262 }
263
264
265 @Override
266 public Section getSection() {
267 return this.section;
268 }
269
270
271
272
273
274
275
276
277
278
279 public void setSection(Section section) {
280 this.section = section;
281 }
282
283
284 @Override
285 public PackagePriority getPriority() {
286 return this.priority;
287 }
288
289
290
291
292
293
294
295
296
297
298 public void setPriority(PackagePriority priority) {
299 this.priority = priority;
300 }
301
302
303 @Override
304 public Boolean getEssential() {
305 return this.essential;
306 }
307
308
309
310
311
312
313
314
315
316
317
318 public void setEssential(Boolean essential) {
319 this.essential = essential;
320 }
321
322
323 @Override
324 public List<PackageDependency> getDepends() {
325 return (new ArrayList<>(this.depends));
326 }
327
328
329
330
331
332
333
334
335
336
337 public void setDepends(List<PackageDependency> depends) {
338 this.depends = getList(depends);
339 }
340
341
342 @Override
343 public List<PackageDependency> getRecommends() {
344 return (new ArrayList<>(this.recommends));
345 }
346
347
348
349
350
351
352
353
354
355
356
357 public void setRecommends(List<PackageDependency> recommends) {
358 this.recommends = getList(recommends);
359 }
360
361
362 @Override
363 public List<PackageDependency> getSuggests() {
364 return (new ArrayList<>(this.suggest));
365 }
366
367
368
369
370
371
372
373
374
375
376
377 public void setSuggests(List<PackageDependency> suggest) {
378 this.suggest = getList(suggest);
379 }
380
381
382 @Override
383 public List<PackageDependency> getEnhances() {
384 return (new ArrayList<>(this.enhances));
385 }
386
387
388
389
390
391
392
393
394
395
396
397 public void setEnhances(List<PackageDependency> enhances) {
398 this.enhances = getList(enhances);
399 }
400
401
402 @Override
403 public List<PackageDependency> getPreDepends() {
404 return (new ArrayList<>(this.preDepends));
405 }
406
407
408
409
410
411
412
413
414
415
416
417 public void setPreDepends(List<PackageDependency> preDepends) {
418 this.preDepends = getList(preDepends);
419 }
420
421
422 @Override
423 public List<PackageDependency> getBreaks() {
424 return (new ArrayList<>(this.breaks));
425 }
426
427
428
429
430
431
432
433
434
435
436 public void setBreaks(List<PackageDependency> breaks) {
437 this.breaks = getList(breaks);
438 }
439
440
441 @Override
442 public List<PackageDependency> getConflicts() {
443 return (new ArrayList<>(this.conflicts));
444 }
445
446
447
448
449
450
451
452
453
454
455 public void setConflicts(List<PackageDependency> conflicts) {
456 this.conflicts = getList(conflicts);
457 }
458
459
460 @Override
461 public List<PackageDependency> getProvides() {
462 return (new ArrayList<>(this.provides));
463 }
464
465
466
467
468
469
470
471
472
473
474 public void setProvides(List<PackageDependency> provides) {
475 this.provides = getList(provides);
476 }
477
478
479 @Override
480 public List<PackageDependency> getReplaces() {
481 return (new ArrayList<>(this.replaces));
482 }
483
484
485
486
487
488
489
490
491
492
493 public void setReplaces(List<PackageDependency> replaces) {
494 this.replaces = getList(replaces);
495 }
496
497
498 @Override
499 public List<PackageDependency> getBuiltUsing() {
500 return (new ArrayList<>(this.builtUsing));
501 }
502
503
504
505
506
507
508
509
510
511
512 public void setBuiltUsing(List<PackageDependency> builtUsing) {
513 this.builtUsing = getList(builtUsing);
514 }
515
516
517 @Override
518 public Size getInstalledSize() {
519 return this.installedSize;
520 }
521
522
523
524
525
526
527
528
529
530
531
532 public void setInstalledSize(Size installedSize) {
533 this.installedSize = installedSize;
534 }
535
536
537 @Override
538 public String getModuleAliases() {
539 return this.moduleAliases;
540 }
541
542
543
544
545
546
547
548
549
550
551 public void setModuleAliases(String moduleAliases) {
552 this.moduleAliases = moduleAliases;
553 }
554
555
556 @Override
557 public Description getDescription() {
558 return this.description;
559 }
560
561
562
563
564
565
566
567
568
569
570 public void setDescription(Description description) {
571 this.description = description;
572 }
573
574
575 }