Package org.eclipse.aether.resolution
Class VersionRangeResult
- java.lang.Object
-
- org.eclipse.aether.resolution.VersionRangeResult
-
public final class VersionRangeResult extends Object
The result of a version range resolution request.
-
-
Constructor Summary
Constructors Constructor Description VersionRangeResult(VersionRangeRequest request)
Creates a new result for the specified request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VersionRangeResult
addException(Exception exception)
Records the specified exception while resolving the version range.VersionRangeResult
addVersion(Version version)
Adds the specified version to the result.List<Exception>
getExceptions()
Gets the exceptions that occurred while resolving the version range.Version
getHighestVersion()
Gets the highest version matching the requested range.Version
getLowestVersion()
Gets the lowest version matching the requested range.ArtifactRepository
getRepository(Version version)
Gets the repository from which the specified version was resolved.VersionRangeRequest
getRequest()
Gets the resolution request that was made.VersionConstraint
getVersionConstraint()
Gets the version constraint that was parsed from the artifact's version string.List<Version>
getVersions()
Gets the versions (in ascending order) that matched the requested range.VersionRangeResult
setRepository(Version version, ArtifactRepository repository)
Records the repository from which the specified version was resolvedVersionRangeResult
setVersionConstraint(VersionConstraint versionConstraint)
Sets the version constraint that was parsed from the artifact's version string.VersionRangeResult
setVersions(List<Version> versions)
Sets the versions (in ascending order) matching the requested range.String
toString()
-
-
-
Constructor Detail
-
VersionRangeResult
public VersionRangeResult(VersionRangeRequest request)
Creates a new result for the specified request.- Parameters:
request
- The resolution request, must not benull
.
-
-
Method Detail
-
getRequest
public VersionRangeRequest getRequest()
Gets the resolution request that was made.- Returns:
- The resolution request, never
null
.
-
getExceptions
public List<Exception> getExceptions()
Gets the exceptions that occurred while resolving the version range.- Returns:
- The exceptions that occurred, never
null
.
-
addException
public VersionRangeResult addException(Exception exception)
Records the specified exception while resolving the version range.- Parameters:
exception
- The exception to record, may benull
.- Returns:
- This result for chaining, never
null
.
-
getVersions
public List<Version> getVersions()
Gets the versions (in ascending order) that matched the requested range.- Returns:
- The matching versions (if any), never
null
.
-
addVersion
public VersionRangeResult addVersion(Version version)
Adds the specified version to the result. Note that versions must be added in ascending order.- Parameters:
version
- The version to add, must not benull
.- Returns:
- This result for chaining, never
null
.
-
setVersions
public VersionRangeResult setVersions(List<Version> versions)
Sets the versions (in ascending order) matching the requested range.- Parameters:
versions
- The matching versions, may be empty ornull
if none.- Returns:
- This result for chaining, never
null
.
-
getLowestVersion
public Version getLowestVersion()
Gets the lowest version matching the requested range.- Returns:
- The lowest matching version or
null
if no versions matched the requested range.
-
getHighestVersion
public Version getHighestVersion()
Gets the highest version matching the requested range.- Returns:
- The highest matching version or
null
if no versions matched the requested range.
-
getRepository
public ArtifactRepository getRepository(Version version)
Gets the repository from which the specified version was resolved.- 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.
-
setRepository
public VersionRangeResult setRepository(Version version, ArtifactRepository repository)
Records the repository from which the specified version was resolved- Parameters:
version
- The version whose source repository is to be recorded, must not benull
.repository
- The repository from which the version was resolved, may benull
.- Returns:
- This result for chaining, never
null
.
-
getVersionConstraint
public VersionConstraint getVersionConstraint()
Gets the version constraint that was parsed from the artifact's version string.- Returns:
- The parsed version constraint or
null
.
-
setVersionConstraint
public VersionRangeResult setVersionConstraint(VersionConstraint versionConstraint)
Sets the version constraint that was parsed from the artifact's version string.- Parameters:
versionConstraint
- The parsed version constraint, may benull
.- Returns:
- This result for chaining, never
null
.
-
-