public class DefaultVersionInfo extends java.lang.Object implements VersionInfo
component-digits-annotation-annotationRevision-buildSpecifiermy-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.| Modifier and Type | Field and Description |
|---|---|
static java.util.regex.Pattern |
ALTERNATE_PATTERN |
static java.util.regex.Pattern |
STANDARD_PATTERN |
| Constructor and Description |
|---|
DefaultVersionInfo(java.util.List digits,
java.lang.String annotation,
java.lang.String annotationRevision,
java.lang.String buildSpecifier,
java.lang.String annotationSeparator,
java.lang.String annotationRevSeparator,
java.lang.String buildSeparator) |
DefaultVersionInfo(java.lang.String version)
Constructs this object and parses the supplied version string.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(java.lang.Object obj)
Compares this
DefaultVersionInfo to the supplied DefaultVersionInfo
to determine which version is greater. |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAnnotation() |
java.lang.String |
getAnnotationRevision() |
java.lang.String |
getBuildSpecifier() |
java.util.List |
getDigits() |
VersionInfo |
getNextVersion()
Returns a
VersionInfo object which represents the next version of this object. |
java.lang.String |
getReleaseVersionString()
Returns a string representing the version without a snapshot specification.
|
java.lang.String |
getSnapshotVersionString()
Returns a string representing the version with a snapshot specification
|
protected static java.lang.String |
getVersionString(DefaultVersionInfo info,
java.lang.String buildSpecifier,
java.lang.String buildSeparator) |
protected java.lang.String |
incrementVersionString(java.lang.String s)
Takes a string and increments it as an integer.
|
boolean |
isSnapshot()
Returns whether this represents a snapshot version.
|
protected static java.lang.String |
joinDigitString(java.util.List digits)
Simply joins the items in the list with "." period
|
java.lang.String |
toString() |
public static final java.util.regex.Pattern STANDARD_PATTERN
public static final java.util.regex.Pattern ALTERNATE_PATTERN
public DefaultVersionInfo(java.lang.String version)
throws VersionParseException
version - VersionParseExceptionpublic DefaultVersionInfo(java.util.List digits,
java.lang.String annotation,
java.lang.String annotationRevision,
java.lang.String buildSpecifier,
java.lang.String annotationSeparator,
java.lang.String annotationRevSeparator,
java.lang.String buildSeparator)
public boolean isSnapshot()
VersionInfoisSnapshot in interface VersionInfopublic VersionInfo getNextVersion()
VersionInfoVersionInfo object which represents the next version of this object.getNextVersion in interface VersionInfopublic int compareTo(java.lang.Object obj)
DefaultVersionInfo to the supplied DefaultVersionInfo
to determine which version is greater.compareTo in interface java.lang.Comparableobj - the comparison versionjava.lang.IllegalArgumentException - if the components differ between the objects or if either of the annotations can not be determined.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectprotected java.lang.String incrementVersionString(java.lang.String s)
s - public java.lang.String getSnapshotVersionString()
VersionInfogetSnapshotVersionString in interface VersionInfopublic java.lang.String getReleaseVersionString()
VersionInfogetReleaseVersionString in interface VersionInfopublic java.lang.String toString()
toString in class java.lang.Objectprotected static java.lang.String getVersionString(DefaultVersionInfo info, java.lang.String buildSpecifier, java.lang.String buildSeparator)
protected static java.lang.String joinDigitString(java.util.List digits)
digits - public java.util.List getDigits()
public java.lang.String getAnnotation()
public java.lang.String getAnnotationRevision()
public java.lang.String getBuildSpecifier()
Copyright © 2002-2014 The Apache Software Foundation. All Rights Reserved.