public interface VersionComparator extends Comparator<org.apache.maven.artifact.versioning.ArtifactVersion>
| Modifier and Type | Method and Description |
|---|---|
int |
getSegmentCount(org.apache.maven.artifact.versioning.ArtifactVersion artifactVersion)
Returns the number of segments specified or specifiable in the supplied artifact version.
|
default org.apache.maven.artifact.versioning.Restriction |
restrictionFor(org.apache.maven.artifact.versioning.ArtifactVersion currentVersion,
Optional<Segment> scope)
Returns a Restriction object for computing version upgrades
with the given segment allowing updates, with all more major segments locked in place.
|
compare, comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongint getSegmentCount(org.apache.maven.artifact.versioning.ArtifactVersion artifactVersion)
artifactVersion - The artifact version to count the segments of.default org.apache.maven.artifact.versioning.Restriction restrictionFor(org.apache.maven.artifact.versioning.ArtifactVersion currentVersion,
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.
currentVersion - The current version.scope - most major segment where updates are allowed Optional.empty() for no restrictionInvalidSegmentExceptionCopyright © 2008–2022 MojoHaus. All rights reserved.