public class Version extends Object implements Comparable<Version>
x.y.z-beta
x.y.z-r20131022
x.y.z-SNAPSHOT
x.y.z
x.y.z-anyclassifier
Modifier and Type | Field and Description |
---|---|
protected String |
classifier |
protected int |
major |
protected int |
minor |
protected int |
patch |
protected boolean |
snapshot |
static String |
SNAPSHOT |
static Pattern |
SPECIAL_CLASSIFIER |
protected boolean |
specialClassifier |
static Version |
ZERO |
Constructor and Description |
---|
Version(int major) |
Version(int major,
int minor) |
Version(int major,
int minor,
int patch) |
Version(int major,
int minor,
int patch,
String classifier) |
Version(String version) |
Modifier and Type | Method and Description |
---|---|
String |
classifier() |
int |
compareTo(Version o) |
boolean |
equals(Object o) |
boolean |
equalsTo(Version v) |
boolean |
greaterOrEqualThan(Version v) |
boolean |
greaterThan(Version v) |
int |
hashCode() |
boolean |
isSnapshot() |
boolean |
isSpecialClassifier()
Special classifiers are considered as earlier than versions without
classifier or with a non-special classifier
|
boolean |
lessOrEqualsThan(Version v) |
boolean |
lessThan(Version v) |
int |
major() |
int |
minor() |
int |
patch() |
void |
setClassifier(String classifier) |
void |
setSnapshot(boolean isSnapshot) |
String |
toString() |
public static final String SNAPSHOT
public static final Version ZERO
public static final Pattern SPECIAL_CLASSIFIER
protected boolean specialClassifier
protected int major
protected int minor
protected int patch
protected String classifier
protected boolean snapshot
public Version(String version)
public Version(int major)
public Version(int major, int minor)
public Version(int major, int minor, int patch)
public Version(int major, int minor, int patch, String classifier)
public boolean isSpecialClassifier()
public int major()
public int minor()
public int patch()
public String classifier()
public boolean lessThan(Version v)
public boolean lessOrEqualsThan(Version v)
public boolean equalsTo(Version v)
public boolean greaterThan(Version v)
public boolean greaterOrEqualThan(Version v)
public int compareTo(Version o)
compareTo
in interface Comparable<Version>
public boolean isSnapshot()
public void setSnapshot(boolean isSnapshot)
public void setClassifier(String classifier)
Copyright © 2016 Nuxeo SA. All Rights Reserved.