1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.repository;
20
21 import java.util.ArrayList;
22 import java.util.List;
23
24
25
26
27
28
29 @Deprecated
30 public class MetadataGraphNode {
31
32 MavenArtifactMetadata metadata;
33
34
35 List<MetadataGraphNode> inNodes;
36
37
38 List<MetadataGraphNode> exNodes;
39
40 public MetadataGraphNode() {
41 inNodes = new ArrayList<>(4);
42 exNodes = new ArrayList<>(8);
43 }
44
45 public MetadataGraphNode(MavenArtifactMetadata metadata) {
46 this();
47 this.metadata = metadata;
48 }
49
50 public MetadataGraphNode addIncident(MetadataGraphNode node) {
51 inNodes.add(node);
52 return this;
53 }
54
55 public MetadataGraphNode addExident(MetadataGraphNode node) {
56 exNodes.add(node);
57 return this;
58 }
59
60 @Override
61 public boolean equals(Object obj) {
62 if (obj == null) {
63 return false;
64 }
65
66 if (MetadataGraphNode.class.isAssignableFrom(obj.getClass())) {
67 MetadataGraphNode node2 = (MetadataGraphNode) obj;
68
69 if (node2.metadata == null) {
70 return metadata == null;
71 }
72
73 return metadata != null && metadata.toString().equals(node2.metadata.toString());
74 } else {
75 return super.equals(obj);
76 }
77 }
78
79 @Override
80 public int hashCode() {
81 if (metadata == null) {
82 return super.hashCode();
83 }
84
85 return metadata.toString().hashCode();
86 }
87 }