Class TestVersionFilterContext
- java.lang.Object
-
- org.eclipse.aether.internal.test.util.TestVersionFilterContext
-
- All Implemented Interfaces:
java.lang.Iterable<Version>
,VersionFilter.VersionFilterContext
class TestVersionFilterContext extends java.lang.Object implements VersionFilter.VersionFilterContext
-
-
Field Summary
Fields Modifier and Type Field Description private Dependency
dependency
private VersionRangeResult
result
private RepositorySystemSession
session
private java.util.List<Version>
versions
-
Constructor Summary
Constructors Constructor Description TestVersionFilterContext(RepositorySystemSession session, VersionRangeResult result)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCount()
Gets the total number of available versions.Dependency
getDependency()
Gets the dependency whose version range is being filtered.java.util.List<RemoteRepository>
getRepositories()
Gets the remote repositories from which the versions were resolved.ArtifactRepository
getRepository(Version version)
Gets the repository from which the specified version was resolved.RepositorySystemSession
getSession()
Gets the repository system session during which the version filtering happens.VersionConstraint
getVersionConstraint()
Gets the version constraint that was parsed from the dependency's version string.java.util.Iterator<Version>
iterator()
Gets an iterator over the available versions of the dependency.
-
-
-
Field Detail
-
session
private final RepositorySystemSession session
-
dependency
private final Dependency dependency
-
result
private final VersionRangeResult result
-
versions
private final java.util.List<Version> versions
-
-
Constructor Detail
-
TestVersionFilterContext
TestVersionFilterContext(RepositorySystemSession session, VersionRangeResult result)
-
-
Method Detail
-
getSession
public RepositorySystemSession getSession()
Description copied from interface:VersionFilter.VersionFilterContext
Gets the repository system session during which the version filtering happens.- Specified by:
getSession
in interfaceVersionFilter.VersionFilterContext
- Returns:
- The repository system session, never
null
.
-
getDependency
public Dependency getDependency()
Description copied from interface:VersionFilter.VersionFilterContext
Gets the dependency whose version range is being filtered.- Specified by:
getDependency
in interfaceVersionFilter.VersionFilterContext
- Returns:
- The dependency, never
null
.
-
getCount
public int getCount()
Description copied from interface:VersionFilter.VersionFilterContext
Gets the total number of available versions. This count reflects any removals made during version filtering.- Specified by:
getCount
in interfaceVersionFilter.VersionFilterContext
- Returns:
- The total number of available versions.
-
iterator
public java.util.Iterator<Version> iterator()
Description copied from interface:VersionFilter.VersionFilterContext
Gets an iterator over the available versions of the dependency. The iterator returns versions in ascending order. UseIterator.remove()
to exclude a version from further consideration in the dependency graph.- Specified by:
iterator
in interfacejava.lang.Iterable<Version>
- Specified by:
iterator
in interfaceVersionFilter.VersionFilterContext
- Returns:
- The iterator of available versions, never
null
.
-
getVersionConstraint
public VersionConstraint getVersionConstraint()
Description copied from interface:VersionFilter.VersionFilterContext
Gets the version constraint that was parsed from the dependency's version string.- Specified by:
getVersionConstraint
in interfaceVersionFilter.VersionFilterContext
- Returns:
- The parsed version constraint, never
null
.
-
getRepository
public ArtifactRepository getRepository(Version version)
Description copied from interface:VersionFilter.VersionFilterContext
Gets the repository from which the specified version was resolved.- Specified by:
getRepository
in interfaceVersionFilter.VersionFilterContext
- Parameters:
version
- The version whose source repository should be retrieved, must not benull
.- Returns:
- The repository from which the version was resolved or
null
if unknown.
-
getRepositories
public java.util.List<RemoteRepository> getRepositories()
Description copied from interface:VersionFilter.VersionFilterContext
Gets the remote repositories from which the versions were resolved.- Specified by:
getRepositories
in interfaceVersionFilter.VersionFilterContext
- Returns:
- The (read-only) list of repositories, never
null
.
-
-