Package org.codehaus.mojo.versions.api
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 TypeMethodDescriptionboolean
containsVersion
(String version) Returnstrue
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 versionorg.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
Returns the current version.org.apache.maven.artifact.versioning.VersionRange
Returns the current version range (may benull
)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
getNewestUpdateWithinSegment
(Optional<Segment> updateScope, boolean includeSnapshots) Returns the newest version newer than the specified current version, only within the segment specified byupdateScope
ornull
if no such version exists.org.apache.maven.artifact.versioning.ArtifactVersion
getNewestUpdateWithinSegment
(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 ornull
if no such version exists.Optional
<org.apache.maven.artifact.versioning.ArtifactVersion> getNewestVersion
(String versionString, Optional<Segment> unchangedSegment, 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.Restriction restriction, boolean includeSnapshots) Returns the latest version newer than the specified current version, but less than the specified upper bound ornull
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 ornull
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 ornull
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, ornull
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.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.org.apache.maven.artifact.versioning.Restriction
restrictionForIgnoreScope
(org.apache.maven.artifact.versioning.ArtifactVersion lowerBound, Optional<Segment> ignored) Returns theRestriction
objects for a segemnt scope which is to be ignored.org.apache.maven.artifact.versioning.Restriction
restrictionForSelectedSegment
(org.apache.maven.artifact.versioning.ArtifactVersion lowerBound, Optional<Segment> selectedSegment) Returns a Restriction object for computing version upgrades within the given segment allowing updates, with all more major segments locked in place, but also ignoring all version updates from lesser scopes.org.apache.maven.artifact.versioning.Restriction
restrictionForUnchangedSegment
(org.apache.maven.artifact.versioning.ArtifactVersion lowerBound, Optional<Segment> unchangedSegment, boolean allowDowngrade) Returns a Restriction object for computing version upgrades within the all segments minor/lesser to the providedunchangedSegment
.void
setCurrentVersion
(String currentVersion) Sets the current version.void
setCurrentVersion
(org.apache.maven.artifact.versioning.ArtifactVersion currentVersion) Sets the current version.void
setCurrentVersionRange
(org.apache.maven.artifact.versioning.VersionRange versionRange) Sets the current version range (may benull
)
-
Method Details
-
containsVersion
Returnstrue
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
-
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
Sets the current version.- Parameters:
currentVersion
- The new current version.- Since:
- 1.0-beta-1
-
getCurrentVersion
org.apache.maven.artifact.versioning.ArtifactVersion getCurrentVersion()Returns the current version.- Returns:
- The current version (may be
null
). - Since:
- 1.0-beta-1
-
getCurrentVersionRange
org.apache.maven.artifact.versioning.VersionRange getCurrentVersionRange()Returns the current version range (may benull
)- Returns:
- current version range (may be
null
) - Since:
- 2.16.0
-
setCurrentVersionRange
void setCurrentVersionRange(org.apache.maven.artifact.versioning.VersionRange versionRange) Sets the current version range (may benull
)- Parameters:
versionRange
- version range to set (may benull
)- Since:
- 2.16.0
-
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.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 wherenull
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, ornull
if no such version exists.- Parameters:
versionRange
- range to look for the versionsrestriction
- restriction restricting the version lookupincludeSnapshots
-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.Restriction restriction, boolean includeSnapshots) Returns the latest version newer than the specified current version, but less than the specified upper bound ornull
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 ornull
if no such version exists.- Parameters:
versionRange
- The version range within which the version must exist wherenull
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 ornull
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> unchangedSegment, 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 versionunchangedSegment
- segment that may not be changed; empty() means no upper boundincludeSnapshots
- whether snapshot versions should be includedallowDowngrade
- 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)
-
getNewestUpdateWithinSegment
org.apache.maven.artifact.versioning.ArtifactVersion getNewestUpdateWithinSegment(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 ornull
if no such version exists.- Parameters:
currentVersion
- the lower bound ornull
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 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 versionupperBoundSegment
- the upper bound segment; empty() means no upper boundincludeSnapshots
- whether snapshot versions should be includedallowDowngrade
- 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 ornull
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
-
getNewestUpdateWithinSegment
org.apache.maven.artifact.versioning.ArtifactVersion getNewestUpdateWithinSegment(Optional<Segment> updateScope, boolean includeSnapshots) throws InvalidSegmentException Returns the newest version newer than the specified current version, only within the segment specified by
updateScope
ornull
if no such version exists.If
updateScope
isOptional.empty()
, will return all updates.- 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
-
restrictionForSelectedSegment
org.apache.maven.artifact.versioning.Restriction restrictionForSelectedSegment(org.apache.maven.artifact.versioning.ArtifactVersion lowerBound, Optional<Segment> selectedSegment) throws InvalidSegmentException Returns a Restriction object for computing version upgrades within the given segment allowing updates, with all more major segments locked in place, but also ignoring all version updates from lesser scopes.
- Parameters:
lowerBound
- artifact version, for which the unchanged segment is computedselectedSegment
- segment, for which the restriction is to be built orOptional.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)
-
restrictionForUnchangedSegment
org.apache.maven.artifact.versioning.Restriction restrictionForUnchangedSegment(org.apache.maven.artifact.versioning.ArtifactVersion lowerBound, Optional<Segment> unchangedSegment, boolean allowDowngrade) throws InvalidSegmentException Returns a Restriction object for computing version upgrades within the all segments minor/lesser to the provided
unchangedSegment
.If the provided segment is
Optional.empty()
, all possible updates are returned.- Parameters:
lowerBound
- artifact version, for which the unchanged segment is computedunchangedSegment
- segment, which should not be changed orOptional.empty()
for no restrictionallowDowngrade
- whether downgrades are allowed- 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(org.apache.maven.artifact.versioning.ArtifactVersion lowerBound, Optional<Segment> ignored) Returns theRestriction
objects for a segemnt scope which is to be ignored.- Parameters:
lowerBound
- artifact version, for which the unchanged segment is computedignored
- most major segment where updates are to be ignored; Optional.empty() for no ignored segments- Returns:
- Restriction object based on the arguments
-