Package org.codehaus.mojo.versions.api
Class ArtifactVersions
java.lang.Object
org.codehaus.mojo.versions.api.AbstractVersionDetails
org.codehaus.mojo.versions.api.ArtifactVersions
- All Implemented Interfaces:
Comparable<ArtifactVersions>,VersionDetails
- Direct Known Subclasses:
PluginUpdatesDetails
public class ArtifactVersions
extends AbstractVersionDetails
implements Comparable<ArtifactVersions>
Holds the results of a search for versions of an artifact.
- Since:
- 1.0-alpha-3
- Author:
- Stephen Connolly
-
Field Summary
Fields inherited from class org.codehaus.mojo.versions.api.AbstractVersionDetails
verboseDetail -
Constructor Summary
ConstructorsConstructorDescriptionArtifactVersions(org.apache.maven.artifact.Artifact artifact, List<org.apache.maven.artifact.versioning.ArtifactVersion> versions, VersionComparator versionComparator) Creates a newArtifactVersionsinstance.ArtifactVersions(ArtifactVersions other) Creates a newArtifactVersionsinstance as shallow copy of the other -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ArtifactVersions that) booleanorg.apache.maven.artifact.ArtifactReturns the artifact who's version information we are holding.Returns the artifactId of the artifact which versions we are holding.Returns the groupId of the artifact which versions we are holding.Returns the artifactId of the artifact which versions we are holding.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.inthashCode()booleanisEmpty(boolean includeSnapshots) Says whether the versions present in theArtifactVersionscollection are empty.static booleanisVersionInRange(org.apache.maven.artifact.versioning.ArtifactVersion version, org.apache.maven.artifact.versioning.VersionRange range) Checks if the version is in the range (and ensures that the range respects the-!syntax to rule out any qualifiers from range boundaries).toString()Methods inherited from class org.codehaus.mojo.versions.api.AbstractVersionDetails
containsVersion, getAllUpdates, getAllUpdates, getAllUpdates, getAllUpdates, getCurrentVersion, getCurrentVersionRange, getHighestLowerBound, getLowerBound, getNewerVersions, getNewestUpdateWithinSegment, getNewestUpdateWithinSegment, getNewestVersion, getNewestVersion, getNewestVersion, getNewestVersion, getNewestVersion, getReportNewestUpdate, getReportUpdates, getSelectedRestriction, getVersions, getVersions, getVersions, isVersionInRestriction, restrictionForIgnoreScope, restrictionForSelectedSegment, restrictionForUnchangedSegment, setCurrentVersion, setCurrentVersion, setCurrentVersionRange
-
Constructor Details
-
ArtifactVersions
public ArtifactVersions(org.apache.maven.artifact.Artifact artifact, List<org.apache.maven.artifact.versioning.ArtifactVersion> versions, VersionComparator versionComparator) Creates a newArtifactVersionsinstance.- Parameters:
artifact- The artifact.versions- The versions.versionComparator- The version comparison rule.- Since:
- 1.0-alpha-3
-
ArtifactVersions
Creates a newArtifactVersionsinstance as shallow copy of the other- Parameters:
other- other object to be linked to- Since:
- 2.13.0
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<ArtifactVersions>
-
equals
-
hashCode
public int hashCode() -
isVersionInRange
public static boolean isVersionInRange(org.apache.maven.artifact.versioning.ArtifactVersion version, org.apache.maven.artifact.versioning.VersionRange range) Checks if the version is in the range (and ensures that the range respects the-!syntax to rule out any qualifiers from range boundaries).- Parameters:
version- the version to check.range- the range to check.- Returns:
trueif and only if the version is in the range.- Since:
- 1.3
-
getArtifact
public org.apache.maven.artifact.Artifact getArtifact()Returns the artifact who's version information we are holding.- Returns:
- the artifact who's version information we are holding.
- Since:
- 1.0-alpha-3
-
getGroupId
Returns the groupId of the artifact which versions we are holding.- Returns:
- the groupId.
- Since:
- 1.0-alpha-3
-
getArtifactId
Returns the artifactId of the artifact which versions we are holding.- Returns:
- the artifactId.
- Since:
- 1.0-alpha-3
-
getVersion
Returns the artifactId of the artifact which versions we are holding.- Returns:
- current version
- Since:
- 2.13.0
-
getVersions
public org.apache.maven.artifact.versioning.ArtifactVersion[] getVersions(boolean includeSnapshots) Description copied from interface:VersionDetailsReturns all available versions in increasing order.- Specified by:
getVersionsin interfaceVersionDetails- Parameters:
includeSnapshots-trueif snapshots are to be included.- Returns:
- all available versions in increasing order.
-
isEmpty
public boolean isEmpty(boolean includeSnapshots) Says whether the versions present in theArtifactVersionscollection are empty. IfincludeSnapshotsistrue, snapshots will not counted, which means that the method will only count release versions.- Parameters:
includeSnapshots-includeSnapshotsistrue, snapshots will not counted, which means that * the method will only count release versions.- Returns:
- if
includeSnapshotsistrue, returnstrueif there are no versions. ifincludeSnapshotsisfalse, returnstrueif there are no releases.
-
getVersionComparator
Description copied from interface:VersionDetailsGets the rule for version comparison of this artifact.- Specified by:
getVersionComparatorin interfaceVersionDetails- Returns:
- the rule for version comparison of this artifact.
-
toString
-