1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.util.file.model;
17
18 import java.util.List;
19
20 import org.kuali.common.util.Assert;
21
22 public class DuplicateArtifact implements Comparable<DuplicateArtifact> {
23
24 public DuplicateArtifact(String path, List<ArtifactForTesting> artifacts) {
25 Assert.noBlanks(path);
26 Assert.noNulls(artifacts);
27 this.path = path;
28 this.artifacts = artifacts;
29 }
30
31 private final String path;
32 private final List<ArtifactForTesting> artifacts;
33
34 @Override
35 public int compareTo(DuplicateArtifact other) {
36 int sizeComparison = Double.compare(artifacts.size(), other.getArtifacts().size());
37 if (sizeComparison == 0) {
38 return path.compareTo(other.getPath());
39 } else {
40 return sizeComparison;
41 }
42 }
43
44 public String getPath() {
45 return path;
46 }
47
48 public List<ArtifactForTesting> getArtifacts() {
49 return artifacts;
50 }
51
52 }