99public final class Fetch {
1010
1111 private final List <Dependency > dependencies ;
12+ private final List <Dependency > bomDependencies ;
1213 private final List <Repository > repositories ;
1314 private Cache cache ;
1415 private Boolean mainArtifacts ;
@@ -19,6 +20,7 @@ public final class Fetch {
1920
2021 private Fetch () {
2122 dependencies = new ArrayList <>();
23+ bomDependencies = new ArrayList <>();
2224 repositories = new ArrayList <>(Arrays .asList (ApiHelper .defaultRepositories ()));
2325 cache = Cache .create ();
2426 mainArtifacts = null ;
@@ -33,6 +35,7 @@ public boolean equals(Object obj) {
3335 if (obj instanceof Fetch ) {
3436 Fetch other = (Fetch ) obj ;
3537 return this .dependencies .equals (other .dependencies ) &&
38+ this .bomDependencies .equals (other .bomDependencies ) &&
3639 this .repositories .equals (other .repositories ) &&
3740 this .cache .equals (other .cache ) &&
3841 Objects .equals (this .mainArtifacts , other .mainArtifacts ) &&
@@ -46,7 +49,7 @@ public boolean equals(Object obj) {
4649
4750 @ Override
4851 public int hashCode () {
49- return 37 * (37 * (37 * (37 * (37 * (37 * (37 * (17 + dependencies .hashCode ()) + repositories .hashCode ()) + cache .hashCode ()) + Objects .hashCode (mainArtifacts )) + classifiers .hashCode ()) + Objects .hashCode (fetchCache )) + resolutionParams .hashCode ()) + Objects .hashCode (artifactTypes );
52+ return 37 * (37 * (37 * (37 * (37 * (37 * (37 * (37 * ( 17 + dependencies . hashCode ()) + bomDependencies .hashCode ()) + repositories .hashCode ()) + cache .hashCode ()) + Objects .hashCode (mainArtifacts )) + classifiers .hashCode ()) + Objects .hashCode (fetchCache )) + resolutionParams .hashCode ()) + Objects .hashCode (artifactTypes );
5053 }
5154
5255 @ Override
@@ -56,6 +59,11 @@ public String toString() {
5659 b .append (dep .toString ());
5760 b .append (", " );
5861 }
62+ b .append ("], bomDependencies=[" );
63+ for (Dependency bomDep : bomDependencies ) {
64+ b .append (bomDep .toString ());
65+ b .append (", " );
66+ }
5967 b .append ("], repositories=[" );
6068 for (Repository repo : repositories ) {
6169 b .append (repo .toString ());
@@ -111,6 +119,17 @@ public Fetch withDependencies(Dependency... dependencies) {
111119 return this ;
112120 }
113121
122+ public Fetch addBomDependencies (Dependency ... bomDependencies ) {
123+ this .bomDependencies .addAll (Arrays .asList (bomDependencies ));
124+ return this ;
125+ }
126+
127+ public Fetch withBomDependencies (Dependency ... bomDependencies ) {
128+ this .bomDependencies .clear ();
129+ this .bomDependencies .addAll (Arrays .asList (bomDependencies ));
130+ return this ;
131+ }
132+
114133 public Fetch addRepositories (Repository ... repositories ) {
115134 this .repositories .addAll (Arrays .asList (repositories ));
116135 return this ;
@@ -195,6 +214,10 @@ public List<Dependency> getDependencies() {
195214 return Collections .unmodifiableList (dependencies );
196215 }
197216
217+ public List <Dependency > getBomDependencies () {
218+ return Collections .unmodifiableList (bomDependencies );
219+ }
220+
198221 public List <Repository > getRepositories () {
199222 return Collections .unmodifiableList (repositories );
200223 }
0 commit comments