public class BoundArtifactVersion
extends org.apache.maven.artifact.versioning.DefaultArtifactVersion
Represents an artifact version with all segments more major or equal to a given segment held in place. It can be thought of as an artifact having +∞ as its upper bound on all segments less major than the held segment.
When compared with another artifact versions, this results with the other object with the segment versions up to the held segment being equal, always comparing lower than this object.
This is particularly helpful for -SNAPSHOT and other versions with qualifiers, which are lower than version 0 in the Maven versioning system.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BoundArtifactVersion.BoundComparableVersion |
| Constructor and Description |
|---|
BoundArtifactVersion(org.apache.maven.artifact.versioning.ArtifactVersion artifactVersion,
Segment segment)
Constructs the instance
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(org.apache.maven.artifact.versioning.ArtifactVersion other) |
boolean |
equals(Object o) |
Segment |
getSegment()
Returns the most major segment that can change.
|
int |
hashCode() |
public BoundArtifactVersion(org.apache.maven.artifact.versioning.ArtifactVersion artifactVersion,
Segment segment)
artifactVersion - artifact version containing the segment version valuessegment - most major segment that can change, i.e. not held in placepublic Segment getSegment()
public int compareTo(org.apache.maven.artifact.versioning.ArtifactVersion other)
compareTo in interface Comparable<org.apache.maven.artifact.versioning.ArtifactVersion>compareTo in class org.apache.maven.artifact.versioning.DefaultArtifactVersionpublic boolean equals(Object o)
equals in class org.apache.maven.artifact.versioning.DefaultArtifactVersionpublic int hashCode()
hashCode in class org.apache.maven.artifact.versioning.DefaultArtifactVersionCopyright © 2008–2022 MojoHaus. All rights reserved.