Interface VersionDetails

All Known Implementing Classes:
AbstractVersionDetails, ArtifactVersions, PluginUpdatesDetails, PropertyVersions

public interface VersionDetails
Created by IntelliJ IDEA.
Since:
1.0-beta-1
Author:
connollys
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if the specific version is in the list of versions.
    org.apache.maven.artifact.versioning.ArtifactVersion[]
    getAllUpdates(boolean includeSnapshots)
    Returns the all versions newer than the specified current version
    org.apache.maven.artifact.versioning.ArtifactVersion[]
    getAllUpdates(Optional<Segment> updateScope, boolean includeSnapshots)
    Returns the all versions newer than the specified current version, but within the specified update scope.
    org.apache.maven.artifact.versioning.ArtifactVersion[]
    getAllUpdates(org.apache.maven.artifact.versioning.ArtifactVersion currentVersion, Optional<Segment> updateScope, boolean includeSnapshots)
    Returns the all versions newer than the specified current version, but within the specified update scope.
    org.apache.maven.artifact.versioning.ArtifactVersion[]
    getAllUpdates(org.apache.maven.artifact.versioning.VersionRange versionRange, boolean includeSnapshots)
    Returns the all versions newer than the specified current version, but within the specified update scope.
    org.apache.maven.artifact.versioning.ArtifactVersion
    Retrieves the current version.
    org.apache.maven.artifact.versioning.ArtifactVersion[]
    getNewerVersions(String version, boolean includeSnapshots)
    Returns an array of newer versions than the given version, given whether snapshots should be included.
    org.apache.maven.artifact.versioning.ArtifactVersion[]
    getNewerVersions(String version, Optional<Segment> upperBoundSegment, boolean includeSnapshots)
    Deprecated.
    org.apache.maven.artifact.versioning.ArtifactVersion[]
    getNewerVersions(String versionString, Optional<Segment> upperBoundSegment, boolean includeSnapshots, boolean allowDowngrade)
    Returns an array of newer versions than the given version, given the upper bound segment and whether snapshots should be included.
    org.apache.maven.artifact.versioning.ArtifactVersion
    getNewestUpdate(Optional<Segment> updateScope, boolean includeSnapshots)
    Returns the newest version newer than the specified current version, but within the specified update scope or null if no such version exists.
    org.apache.maven.artifact.versioning.ArtifactVersion
    getNewestUpdate(org.apache.maven.artifact.versioning.ArtifactVersion currentVersion, Optional<Segment> updateScope, boolean includeSnapshots)
    Returns the newest version newer than the specified current version, but within the specified update scope or null if no such version exists.
    Optional<org.apache.maven.artifact.versioning.ArtifactVersion>
    getNewestVersion(String versionString, Optional<Segment> upperBoundSegment, boolean includeSnapshots, boolean allowDowngrade)
    Returns the latest version, newer than the given version, given the upper bound segment and whether snapshots should be included.
    org.apache.maven.artifact.versioning.ArtifactVersion
    getNewestVersion(org.apache.maven.artifact.versioning.ArtifactVersion lowerBound, org.apache.maven.artifact.versioning.ArtifactVersion upperBound, boolean includeSnapshots)
    Returns the latest version newer than the specified lowerBound, but less than the specified upper bound or null if no such version exists.
    org.apache.maven.artifact.versioning.ArtifactVersion
    getNewestVersion(org.apache.maven.artifact.versioning.Restriction restriction, boolean includeSnapshots)
    Returns the latest version newer than the specified current version, but less than the specified upper bound or null if no such version exists.
    org.apache.maven.artifact.versioning.ArtifactVersion
    getNewestVersion(org.apache.maven.artifact.versioning.VersionRange versionRange, boolean includeSnapshots)
    Returns the latest version within the specified version range or null if no such version exists.
    org.apache.maven.artifact.versioning.ArtifactVersion
    getNewestVersion(org.apache.maven.artifact.versioning.VersionRange versionRange, org.apache.maven.artifact.versioning.Restriction restriction, boolean includeSnapshots)
    Returns the latest version newer than the specified current version, but less than the specified upper bound or null if no such version exists.
    org.apache.maven.artifact.versioning.ArtifactVersion
    getNewestVersion(org.apache.maven.artifact.versioning.VersionRange versionRange, org.apache.maven.artifact.versioning.Restriction restriction, boolean includeSnapshots, boolean allowDowngrade)
    Returns the latest version given the version range, restricition, whether to include snapshots and/or allow downgrades, or null if no such version exists.
    Gets the rule for version comparison of this artifact.
    org.apache.maven.artifact.versioning.ArtifactVersion[]
    getVersions(boolean includeSnapshots)
    Returns all available versions in increasing order.
    org.apache.maven.artifact.versioning.ArtifactVersion[]
    getVersions(org.apache.maven.artifact.versioning.ArtifactVersion lowerBound, org.apache.maven.artifact.versioning.ArtifactVersion upperBound, boolean includeSnapshots)
    Returns all available versions within the specified bounds.
    org.apache.maven.artifact.versioning.ArtifactVersion[]
    getVersions(org.apache.maven.artifact.versioning.Restriction restriction, boolean includeSnapshots)
    Returns all available versions within the specified bounds.
    org.apache.maven.artifact.versioning.ArtifactVersion[]
    getVersions(org.apache.maven.artifact.versioning.VersionRange versionRange, boolean includeSnapshots)
    Returns all available versions within the specified version range.
    org.apache.maven.artifact.versioning.ArtifactVersion[]
    getVersions(org.apache.maven.artifact.versioning.VersionRange versionRange, org.apache.maven.artifact.versioning.Restriction restriction, boolean includeSnapshots)
    Returns all available versions within the specified bounds.
    boolean
    Returns true if and only if getCurrentVersion() != null.
    org.apache.maven.artifact.versioning.Restriction
    Returns a Restriction object for computing version upgrades with the given segment allowing updates, with all more major segments locked in place.
    org.apache.maven.artifact.versioning.Restriction
    Returns the Restriction objects for a segemnt scope which is to be ignored.
    void
    setCurrentVersion(String currentVersion)
    Sets the current version.
    void
    setCurrentVersion(org.apache.maven.artifact.versioning.ArtifactVersion currentVersion)
    Sets the current version.
  • Method Details

    • containsVersion

      boolean containsVersion(String version)
      Returns true if the specific version is in the list of versions.
      Parameters:
      version - the specific version.
      Returns:
      true if the specific version is in the list of versions.
      Since:
      1.0-beta-1
    • isCurrentVersionDefined

      boolean isCurrentVersionDefined()
      Returns true if and only if getCurrentVersion() != null.
      Returns:
      true if and only if getCurrentVersion() != null.
      Since:
      1.0-beta-1
    • setCurrentVersion

      void setCurrentVersion(org.apache.maven.artifact.versioning.ArtifactVersion currentVersion)
      Sets the current version.
      Parameters:
      currentVersion - The new current version.
      Since:
      1.0-beta-1
    • setCurrentVersion

      void setCurrentVersion(String currentVersion)
      Sets the current version.
      Parameters:
      currentVersion - The new current version.
      Since:
      1.0-beta-1
    • getCurrentVersion

      org.apache.maven.artifact.versioning.ArtifactVersion getCurrentVersion()
      Retrieves the current version.
      Returns:
      The current version (may be null).
      Since:
      1.0-beta-1
    • getVersionComparator

      VersionComparator getVersionComparator()
      Gets the rule for version comparison of this artifact.
      Returns:
      the rule for version comparison of this artifact.
      Since:
      1.0-beta-1
    • getVersions

      org.apache.maven.artifact.versioning.ArtifactVersion[] getVersions(boolean includeSnapshots)
      Returns all available versions in increasing order.
      Parameters:
      includeSnapshots - true if snapshots are to be included.
      Returns:
      all available versions in increasing order.
      Since:
      1.0-alpha-3
    • getVersions

      org.apache.maven.artifact.versioning.ArtifactVersion[] getVersions(org.apache.maven.artifact.versioning.VersionRange versionRange, boolean includeSnapshots)
      Returns all available versions within the specified version range.
      Parameters:
      versionRange - The version range within which the version must exist.
      includeSnapshots - true if snapshots are to be included.
      Returns:
      all available versions within the specified version range.
      Since:
      1.0-alpha-3
    • getVersions

      org.apache.maven.artifact.versioning.ArtifactVersion[] getVersions(org.apache.maven.artifact.versioning.ArtifactVersion lowerBound, org.apache.maven.artifact.versioning.ArtifactVersion upperBound, boolean includeSnapshots)
      Returns all available versions within the specified bounds.
      Parameters:
      lowerBound - the lower bound or null if the lower limit is unbounded.
      upperBound - the upper bound or null if the upper limit is unbounded.
      includeSnapshots - true if snapshots are to be included.
      Returns:
      all available versions within the specified version range.
      Since:
      1.0-beta-1
    • getVersions

      org.apache.maven.artifact.versioning.ArtifactVersion[] getVersions(org.apache.maven.artifact.versioning.Restriction restriction, boolean includeSnapshots)
      Returns all available versions within the specified bounds.
      Parameters:
      restriction - version criteria.
      includeSnapshots - true if snapshots are to be included.
      Returns:
      all available versions within the specified version range.
      Since:
      1.0-beta-1
    • getVersions

      org.apache.maven.artifact.versioning.ArtifactVersion[] getVersions(org.apache.maven.artifact.versioning.VersionRange versionRange, org.apache.maven.artifact.versioning.Restriction restriction, boolean includeSnapshots)
      Returns all available versions within the specified bounds.
      Parameters:
      versionRange - The version range within which the version must exist where null imples [,).
      restriction - version criteria.
      includeSnapshots - true if snapshots are to be included.
      Returns:
      all available versions within the specified version range.
      Since:
      1.0-beta-1
    • getNewestVersion

      org.apache.maven.artifact.versioning.ArtifactVersion getNewestVersion(org.apache.maven.artifact.versioning.VersionRange versionRange, org.apache.maven.artifact.versioning.Restriction restriction, boolean includeSnapshots, boolean allowDowngrade)
      Returns the latest version given the version range, restricition, whether to include snapshots and/or allow downgrades, or null if no such version exists.
      Parameters:
      versionRange - range to look for the versions
      restriction - restriction restricting the version lookup
      includeSnapshots - true if snapshots are to be included.
      allowDowngrade - whether downgrades are allowed
      Returns:
      the latest version satisfying the conditions or null if no version is available.
    • getNewestVersion

      org.apache.maven.artifact.versioning.ArtifactVersion getNewestVersion(org.apache.maven.artifact.versioning.ArtifactVersion lowerBound, org.apache.maven.artifact.versioning.ArtifactVersion upperBound, boolean includeSnapshots)
      Returns the latest version newer than the specified lowerBound, but less than the specified upper bound or null if no such version exists.
      Parameters:
      lowerBound - the lower bound or null if the lower limit is unbounded.
      upperBound - the upper bound or null if the upper limit is unbounded.
      includeSnapshots - true if snapshots are to be included.
      Returns:
      the latest version between currentVersion and upperBound or null if no version is available.
      Since:
      1.0-alpha-3
    • getNewestVersion

      org.apache.maven.artifact.versioning.ArtifactVersion getNewestVersion(org.apache.maven.artifact.versioning.Restriction restriction, boolean includeSnapshots)
      Returns the latest version newer than the specified current version, but less than the specified upper bound or null if no such version exists.
      Parameters:
      restriction - version criteria.
      includeSnapshots - true if snapshots are to be included.
      Returns:
      the latest version between lowerBound and upperBound or null if no version is available.
      Since:
      1.0-alpha-3
    • getNewestVersion

      org.apache.maven.artifact.versioning.ArtifactVersion getNewestVersion(org.apache.maven.artifact.versioning.VersionRange versionRange, org.apache.maven.artifact.versioning.Restriction restriction, boolean includeSnapshots)
      Returns the latest version newer than the specified current version, but less than the specified upper bound or null if no such version exists.
      Parameters:
      versionRange - The version range within which the version must exist where null imples [,).
      restriction - version criteria.
      includeSnapshots - true if snapshots are to be included.
      Returns:
      the latest version between lowerBound and upperBound or null if no version is available.
      Since:
      1.0-alpha-3
    • getNewestVersion

      org.apache.maven.artifact.versioning.ArtifactVersion getNewestVersion(org.apache.maven.artifact.versioning.VersionRange versionRange, boolean includeSnapshots)
      Returns the latest version within the specified version range or null if no such version exists.
      Parameters:
      versionRange - The version range within which the version must exist.
      includeSnapshots - true if snapshots are to be included.
      Returns:
      the latest version within the version range or null if no version is available.
      Since:
      1.0-alpha-3
    • getNewestVersion

      Optional<org.apache.maven.artifact.versioning.ArtifactVersion> getNewestVersion(String versionString, Optional<Segment> upperBoundSegment, boolean includeSnapshots, boolean allowDowngrade) throws InvalidSegmentException
      Returns the latest version, newer than the given version, given the upper bound segment and whether snapshots should be included.
      Parameters:
      versionString - current version
      upperBoundSegment - the upper bound segment; empty() means no upper bound
      includeSnapshots - whether snapshot versions should be included
      allowDowngrade - whether to allow downgrading if the current version is a snapshots and snapshots are disallowed
      Returns:
      newer version or Optional.empty() if none can be found
      Throws:
      InvalidSegmentException - if the requested segment is outside the bounds (less than 1 or greater than the segment count)
    • getNewestUpdate

      org.apache.maven.artifact.versioning.ArtifactVersion getNewestUpdate(org.apache.maven.artifact.versioning.ArtifactVersion currentVersion, Optional<Segment> updateScope, boolean includeSnapshots) throws InvalidSegmentException
      Returns the newest version newer than the specified current version, but within the specified update scope or null if no such version exists.
      Parameters:
      currentVersion - the lower bound or null if the lower limit is unbounded.
      updateScope - the update scope to include.
      includeSnapshots - true if snapshots are to be included.
      Returns:
      the newest version after currentVersion within the specified update scope or null if no version is available.
      Throws:
      InvalidSegmentException - thrown if the updateScope is greater than the number of segments
      Since:
      1.0-beta-1
    • getNewerVersions

      org.apache.maven.artifact.versioning.ArtifactVersion[] getNewerVersions(String version, boolean includeSnapshots)
      Returns an array of newer versions than the given version, given whether snapshots should be included.
      Parameters:
      version - current version in String format
      includeSnapshots - whether snapshot versions should be included
      Returns:
      array of newer versions fulfilling the criteria
    • getNewerVersions

      org.apache.maven.artifact.versioning.ArtifactVersion[] getNewerVersions(String version, Optional<Segment> upperBoundSegment, boolean includeSnapshots) throws InvalidSegmentException
      Deprecated.
      Returns an array of newer versions than the given version, given the upper bound segment and whether snapshots should be included.
      Parameters:
      version - current version
      upperBoundSegment - the upper bound segment; empty() means no upper bound
      includeSnapshots - whether snapshot versions should be included
      Returns:
      array of newer versions fulfilling the criteria
      Throws:
      InvalidSegmentException - if the requested segment is outside the bounds (less than 1 or greater than the segment count)
    • getNewerVersions

      org.apache.maven.artifact.versioning.ArtifactVersion[] getNewerVersions(String versionString, Optional<Segment> upperBoundSegment, boolean includeSnapshots, boolean allowDowngrade) throws InvalidSegmentException
      Returns an array of newer versions than the given version, given the upper bound segment and whether snapshots should be included.
      Parameters:
      versionString - current version
      upperBoundSegment - the upper bound segment; empty() means no upper bound
      includeSnapshots - whether snapshot versions should be included
      allowDowngrade - whether to allow downgrading if the current version is a snapshots and snapshots are disallowed
      Returns:
      array of newer versions fulfilling the criteria
      Throws:
      InvalidSegmentException - if the requested segment is outside the bounds (less than 1 or greater than the segment count)
    • getAllUpdates

      org.apache.maven.artifact.versioning.ArtifactVersion[] getAllUpdates(org.apache.maven.artifact.versioning.ArtifactVersion currentVersion, Optional<Segment> updateScope, boolean includeSnapshots) throws InvalidSegmentException
      Returns the all versions newer than the specified current version, but within the specified update scope.
      Parameters:
      currentVersion - the lower bound or null if the lower limit is unbounded.
      updateScope - the update scope to include.
      includeSnapshots - true if snapshots are to be included.
      Returns:
      the all versions after currentVersion within the specified update scope.
      Throws:
      InvalidSegmentException - thrown if the updateScope is greater than the number of segments
      Since:
      1.0-beta-1
    • getNewestUpdate

      org.apache.maven.artifact.versioning.ArtifactVersion getNewestUpdate(Optional<Segment> updateScope, boolean includeSnapshots) throws InvalidSegmentException
      Returns the newest version newer than the specified current version, but within the specified update scope or null if no such version exists.
      Parameters:
      updateScope - the update scope to include.
      includeSnapshots - true if snapshots are to be included.
      Returns:
      the newest version after currentVersion within the specified update scope or null if no version is available.
      Throws:
      InvalidSegmentException - thrown if the updateScope is greater than the number of segments
      Since:
      1.0-beta-1
    • getAllUpdates

      org.apache.maven.artifact.versioning.ArtifactVersion[] getAllUpdates(Optional<Segment> updateScope, boolean includeSnapshots) throws InvalidSegmentException
      Returns the all versions newer than the specified current version, but within the specified update scope.
      Parameters:
      updateScope - the update scope to include.
      includeSnapshots - true if snapshots are to be included.
      Returns:
      the all versions after currentVersion within the specified update scope.
      Throws:
      InvalidSegmentException - thrown if the updateScope is greater than the number of segments
      Since:
      1.0-beta-1
    • getAllUpdates

      org.apache.maven.artifact.versioning.ArtifactVersion[] getAllUpdates(boolean includeSnapshots)
      Returns the all versions newer than the specified current version
      Parameters:
      includeSnapshots - true if snapshots are to be included.
      Returns:
      the all versions after currentVersion
      Since:
      2.13.0
    • getAllUpdates

      org.apache.maven.artifact.versioning.ArtifactVersion[] getAllUpdates(org.apache.maven.artifact.versioning.VersionRange versionRange, boolean includeSnapshots)
      Returns the all versions newer than the specified current version, but within the specified update scope.
      Parameters:
      versionRange - the version range to include.
      includeSnapshots - true if snapshots are to be included.
      Returns:
      the all versions after currentVersion within the specified update scope.
      Since:
      1.0-beta-1
    • restrictionFor

      org.apache.maven.artifact.versioning.Restriction restrictionFor(Optional<Segment> scope) throws InvalidSegmentException

      Returns a Restriction object for computing version upgrades with the given segment allowing updates, with all more major segments locked in place.

      The resulting restriction could be thought of as one retaining the versions on positions up to the held position, the position right after the position held in place will be incremented by one, and on all positions which are more minor than that, the range would contain -∞ for the bottom bound and +∞ for the above bound.

      This will allow matching the required versions while not matching versions which are considered inferior than the zeroth version, i.e. versions with a qualifier.

      Parameters:
      scope - most major segment where updates are allowed Optional.empty() for no restriction
      Returns:
      Restriction object based on the arguments
      Throws:
      InvalidSegmentException - if the requested segment is outside the bounds (less than 1 or greater than the segment count)
    • restrictionForIgnoreScope

      org.apache.maven.artifact.versioning.Restriction restrictionForIgnoreScope(Optional<Segment> ignored)
      Returns the Restriction objects for a segemnt scope which is to be ignored.
      Parameters:
      ignored - most major segment where updates are to be ignored; Optional.empty() for no ignored segments
      Returns:
      Restriction object based on the arguments