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 classDefaultVersionFilterContext.VersionIterator
-
Field Summary
Fields Modifier and Type Field Description (package private) intcount(package private) byte[]deletedprivate Dependencydependency(package private) VersionRangeResultresultprivate RepositorySystemSessionsession
-
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()intgetCount()Gets the total number of available versions.DependencygetDependency()Gets the dependency whose version range is being filtered.java.util.List<RemoteRepository>getRepositories()Gets the remote repositories from which the versions were resolved.ArtifactRepositorygetRepository(Version version)Gets the repository from which the specified version was resolved.RepositorySystemSessiongetSession()Gets the repository system session during which the version filtering happens.VersionConstraintgetVersionConstraint()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.voidset(Dependency dependency, VersionRangeResult result)java.lang.StringtoString()
-
-
-
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.VersionFilterContextGets the repository system session during which the version filtering happens.- Specified by:
getSessionin interfaceVersionFilter.VersionFilterContext- Returns:
- The repository system session, never
null.
-
getDependency
public Dependency getDependency()
Description copied from interface:VersionFilter.VersionFilterContextGets the dependency whose version range is being filtered.- Specified by:
getDependencyin interfaceVersionFilter.VersionFilterContext- Returns:
- The dependency, never
null.
-
getVersionConstraint
public VersionConstraint getVersionConstraint()
Description copied from interface:VersionFilter.VersionFilterContextGets the version constraint that was parsed from the dependency's version string.- Specified by:
getVersionConstraintin interfaceVersionFilter.VersionFilterContext- Returns:
- The parsed version constraint, never
null.
-
getCount
public int getCount()
Description copied from interface:VersionFilter.VersionFilterContextGets the total number of available versions. This count reflects any removals made during version filtering.- Specified by:
getCountin interfaceVersionFilter.VersionFilterContext- Returns:
- The total number of available versions.
-
getRepository
public ArtifactRepository getRepository(Version version)
Description copied from interface:VersionFilter.VersionFilterContextGets the repository from which the specified version was resolved.- Specified by:
getRepositoryin 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
nullif unknown.
-
getRepositories
public java.util.List<RemoteRepository> getRepositories()
Description copied from interface:VersionFilter.VersionFilterContextGets the remote repositories from which the versions were resolved.- Specified by:
getRepositoriesin interfaceVersionFilter.VersionFilterContext- Returns:
- The (read-only) list of repositories, never
null.
-
iterator
public java.util.Iterator<Version> iterator()
Description copied from interface:VersionFilter.VersionFilterContextGets 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:
iteratorin interfacejava.lang.Iterable<Version>- Specified by:
iteratorin interfaceVersionFilter.VersionFilterContext- Returns:
- The iterator of available versions, never
null.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-