1 package org.eclipse.aether.internal.impl.collect;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.List;
23
24 import org.eclipse.aether.RepositorySystemSession;
25 import org.eclipse.aether.artifact.Artifact;
26 import org.eclipse.aether.collection.DependencyCollectionContext;
27 import org.eclipse.aether.graph.Dependency;
28
29
30
31
32 final class DefaultDependencyCollectionContext
33 implements DependencyCollectionContext
34 {
35
36 private final RepositorySystemSession session;
37
38 private Artifact artifact;
39
40 private Dependency dependency;
41
42 private List<Dependency> managedDependencies;
43
44 DefaultDependencyCollectionContext( RepositorySystemSession session, Artifact artifact,
45 Dependency dependency, List<Dependency> managedDependencies )
46 {
47 this.session = session;
48 this.artifact = ( dependency != null ) ? dependency.getArtifact() : artifact;
49 this.dependency = dependency;
50 this.managedDependencies = managedDependencies;
51 }
52
53 public RepositorySystemSession getSession()
54 {
55 return session;
56 }
57
58 public Artifact getArtifact()
59 {
60 return artifact;
61 }
62
63 public Dependency getDependency()
64 {
65 return dependency;
66 }
67
68 public List<Dependency> getManagedDependencies()
69 {
70 return managedDependencies;
71 }
72
73 public void set( Dependency dependency, List<Dependency> managedDependencies )
74 {
75 artifact = dependency.getArtifact();
76 this.dependency = dependency;
77 this.managedDependencies = managedDependencies;
78 }
79
80 @Override
81 public String toString()
82 {
83 return String.valueOf( getDependency() );
84 }
85
86 }