Class DefaultVersionFilterContext
- java.lang.Object
-
- org.eclipse.aether.internal.impl.collect.DefaultVersionFilterContext
-
- All Implemented Interfaces:
java.lang.Iterable<Version>
,VersionFilter.VersionFilterContext
final class DefaultVersionFilterContext extends java.lang.Object implements VersionFilter.VersionFilterContext
- See Also:
DefaultDependencyCollector
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
DefaultVersionFilterContext.VersionIterator
-
Field Summary
Fields Modifier and Type Field Description (package private) int
count
(package private) byte[]
deleted
private Dependency
dependency
(package private) VersionRangeResult
result
private RepositorySystemSession
session
-
Constructor Summary
Constructors Constructor Description DefaultVersionFilterContext(RepositorySystemSession session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Version>
get()
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.void
set(Dependency dependency, VersionRangeResult result)
java.lang.String
toString()
-
-
-
Field Detail
-
session
private final RepositorySystemSession session
-
dependency
private Dependency dependency
-
result
VersionRangeResult result
-
count
int count
-
deleted
byte[] deleted
-
-
Constructor Detail
-
DefaultVersionFilterContext
DefaultVersionFilterContext(RepositorySystemSession session)
-
-
Method Detail
-
set
public void set(Dependency dependency, VersionRangeResult result)
-
get
public java.util.List<Version> get()
-
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
.
-
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
.
-
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.
-
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
.
-
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
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-