|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.maven.shared.release.versions.DefaultVersionInfo
public class DefaultVersionInfo
This compares and increments versions for a common java versioning scheme.
The supported version scheme has the following parts.component-digits-annotation-annotationRevision-buildSpecifier
my-component-1.0.1-alpha-2-SNAPSHOT
log4j-1.2.9-beta-9-SNAPSHOT == log4j1.2.9beta9SNAPSHOT == log4j_1.2.9_beta_9_SNAPSHOT
Leading zeros are significant when performing comparisons.
TODO: this parser is better than DefaultArtifactVersion - replace it with this (but align naming) and then remove this from here.
Field Summary | |
---|---|
static Pattern |
ALTERNATE_PATTERN
|
static Pattern |
STANDARD_PATTERN
|
Constructor Summary | |
---|---|
DefaultVersionInfo(List<String> digits,
String annotation,
String annotationRevision,
String buildSpecifier,
String annotationSeparator,
String annotationRevSeparator,
String buildSeparator)
|
|
DefaultVersionInfo(String version)
Constructs this object and parses the supplied version string. |
Method Summary | |
---|---|
int |
compareTo(VersionInfo obj)
Compares this DefaultVersionInfo to the supplied DefaultVersionInfo
to determine which version is greater. |
boolean |
equals(Object obj)
|
String |
getAnnotation()
|
String |
getAnnotationRevision()
|
String |
getBuildSpecifier()
|
List<String> |
getDigits()
|
VersionInfo |
getNextVersion()
Returns a VersionInfo object which represents the next version of this object. |
String |
getReleaseVersionString()
Returns a string representing the version without a snapshot specification. |
String |
getSnapshotVersionString()
Returns a string representing the version with a snapshot specification |
protected static String |
getVersionString(DefaultVersionInfo info,
String buildSpecifier,
String buildSeparator)
|
protected String |
incrementVersionString(String s)
Takes a string and increments it as an integer. |
boolean |
isSnapshot()
Returns whether this represents a snapshot version. |
protected static String |
joinDigitString(List<String> digits)
Simply joins the items in the list with "." period |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Pattern STANDARD_PATTERN
public static final Pattern ALTERNATE_PATTERN
Constructor Detail |
---|
public DefaultVersionInfo(String version) throws VersionParseException
version
-
VersionParseException
public DefaultVersionInfo(List<String> digits, String annotation, String annotationRevision, String buildSpecifier, String annotationSeparator, String annotationRevSeparator, String buildSeparator)
Method Detail |
---|
public boolean isSnapshot()
VersionInfo
isSnapshot
in interface VersionInfo
public VersionInfo getNextVersion()
VersionInfo
VersionInfo
object which represents the next version of this object.
getNextVersion
in interface VersionInfo
public int compareTo(VersionInfo obj)
DefaultVersionInfo
to the supplied DefaultVersionInfo
to determine which version is greater.
compareTo
in interface Comparable<VersionInfo>
obj
- the comparison version
IllegalArgumentException
- if the components differ between the objects or if either of the annotations can not be determined.public boolean equals(Object obj)
equals
in class Object
protected String incrementVersionString(String s)
s
- public String getSnapshotVersionString()
VersionInfo
getSnapshotVersionString
in interface VersionInfo
public String getReleaseVersionString()
VersionInfo
getReleaseVersionString
in interface VersionInfo
public String toString()
toString
in class Object
protected static String getVersionString(DefaultVersionInfo info, String buildSpecifier, String buildSeparator)
protected static String joinDigitString(List<String> digits)
digits
- public List<String> getDigits()
public String getAnnotation()
public String getAnnotationRevision()
public String getBuildSpecifier()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |