@Beta public final class ArtifactVersion extends Object implements Comparable<ArtifactVersion>
parse version string in format of [major].[minor].[fix](-|.)[suffix]
Constructor and Description |
---|
ArtifactVersion(String str)
Constructs an instance by parsing the given string.
|
ArtifactVersion(String str,
boolean matchSuffix)
Constructs an instance by parsing the given string.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ArtifactVersion other) |
boolean |
equals(Object o) |
Integer |
getFix()
get the fix version of artifact
|
Integer |
getMajor()
get the major version of artifact
|
Integer |
getMinor()
get the minor version of artifact
|
String |
getSuffix()
get the artifact version suffix
|
String |
getVersion()
get the version string of artifact
|
int |
hashCode() |
boolean |
isSnapshot()
get if artifact version is a snapshot version
|
String |
toString() |
public ArtifactVersion(String str)
getVersion()
will return null.str
- the version string. The whole string needs to match with the version pattern
supported by this class.public ArtifactVersion(String str, boolean matchSuffix)
getVersion()
will return null.str
- the version string.matchSuffix
- if true
, try to match the version pattern by the suffix of the
string. Otherwise match the whole string.@Nullable public String getVersion()
@Nullable public Integer getMajor()
@Nullable public Integer getMinor()
@Nullable public Integer getFix()
@Nullable public String getSuffix()
public boolean isSnapshot()
public int compareTo(ArtifactVersion other)
compareTo
in interface Comparable<ArtifactVersion>
Copyright © 2024 Cask Data, Inc. Licensed under the Apache License, Version 2.0.