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.
  See Also:
    `RepositorySystem.resolveVersionRange(RepositorySystemSession, VersionRangeRequest)`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `VersionRangeResult(VersionRangeRequest request)` Creates a new result for the specified request.

  - ### Method Summary

    Methods
    Modifier and Type | Method and 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 resolved
    `VersionRangeResult` | `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()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### VersionRangeResult

          public VersionRangeResult(VersionRangeRequest request)

      Creates a new result for the specified request.
      Parameters:
        `request` - The resolution request, must not be `null`.

  - ### 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 be `null`.
      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.
      Parameters:
        `version` - The version to add, must not be `null`.
      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 or `null` 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 be `null`.
      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 be `null`.
        `repository` - The repository from which the version was resolved, may be `null`.
      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 be `null`.
      Returns:
        This result for chaining, never `null`.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2010-2012 The Eclipse Foundation. All Rights Reserved.