|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.util.VersionUtil
public class VersionUtil
Class of usefull methods on Version objects.
There is some factory methods : valueOf(XXX) to obtain a new
version.
Some methods to transform a version (since version are immutable, we can not
modify Version's property) :
- inc(Version) : to increment a version - dec(Version) : to decrement a version - addClassifier(Version, String, Integer) : to add a classifier to a version - removeClassifier(Version) : to remove a classifier from a version
| Nested Class Summary | |
|---|---|
static class |
VersionUtil.VersionComparator
L'implantation d'un comparateur de versions permettant de controler l'ordre du numero de version, classifier et numero de classifer. |
| Field Summary | |
|---|---|
static VersionUtil.VersionComparator |
DEFAULT_VERSION_COMPARATOR
Shared instance of default version comparator. |
static String |
SNAPSHOT_SUFFIX
The snapshot suffix. |
static Pattern |
VERSION_PATTERN
Pattern pour detecter une version. |
| Constructor Summary | |
|---|---|
VersionUtil()
|
|
| Method Summary | |
|---|---|
static Version |
addClassifier(Version version,
String classifier,
Integer classifierNumber)
Construction d'une nouvelle version avec un classifier a partir d'une version donnee. |
static boolean |
equals(String version0,
String version1)
Tests if two versions are equals. |
static List<Version> |
filterVersions(Set<Version> versions,
Version min,
Version max,
boolean includeMin,
boolean includeMax)
Filter versions. |
static boolean |
greaterThan(String version0,
String version1)
Tests if the first version is greater than the second version. |
static Version |
inc(Version v)
Incremente le numero de version donnee, seul le dernier constituant est incremente: 1.2.3.4 -> 1.2.3.5; null -> 1; 0 -> 1. |
static void |
main(String... args)
Trier un ensemble de versions données en entrees On affiche le resultat dans la console |
static Version |
removeClassifier(Version version)
Construction d'une nouvelle version sans classifier a partir d'une version donnee (sans classifier). |
static String |
removeSnapshot(String version)
Remove the suffix -SNAPSHOT stamp from a version (if any). |
static boolean |
smallerThan(String version0,
String version1)
Tests if the first version is smaller than the second version. |
static Version |
valueOf(int... numbers)
Recuperation d'une instance de version simple (sans classifier). |
static Version |
valueOf(String version)
Recuperation d'une instance de version a partir de sa version textuelle. |
static Version |
valueOf(String classifier,
Integer classifierNumber,
int... numbers)
Recuperation d'une instance de version. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Pattern VERSION_PATTERN
public static final VersionUtil.VersionComparator DEFAULT_VERSION_COMPARATOR
VersionUtil.VersionComparatorpublic static final String SNAPSHOT_SUFFIX
| Constructor Detail |
|---|
public VersionUtil()
| Method Detail |
|---|
public static Version valueOf(int... numbers)
numbers - les nombres de la version
public static Version valueOf(String classifier,
Integer classifierNumber,
int... numbers)
classifier - le classifier (peut-etre null)classifierNumber - la version du classifier (doit etre null si le classifier est null)numbers - les nombres de la version
public static Version valueOf(String version)
version - la representation textuelle de la version
public static Version addClassifier(Version version,
String classifier,
Integer classifierNumber)
throws NullPointerException,
IllegalArgumentException
version - la version de base (sans classifier)classifier - le classifier a ajouterclassifierNumber - la version du classifier a ajouter
NullPointerException - si le classifier ou le classifierNumber est null.
IllegalArgumentException - si la version donnee contient deja un classifier.
public static Version removeClassifier(Version version)
throws IllegalArgumentException
version - la version de base (avec classifier)
IllegalArgumentException - si la version donnee contient deja
un classifier.public static Version inc(Version v)
v - la version a incrementer
public static String removeSnapshot(String version)
throws NullPointerException
-SNAPSHOT stamp from a version (if any).
version - the string representation of the version
-SNAPSHOT suffix (if any).
NullPointerException - if version is null
public static List<Version> filterVersions(Set<Version> versions,
Version min,
Version max,
boolean includeMin,
boolean includeMax)
versions - versions to filtermin - min version to acceptmax - max version to acceptincludeMin - flag to include min versionincludeMax - flag to include max version
public static boolean equals(String version0,
String version1)
version0 - the first versionversion1 - the second version
true if versions are equals, false otherwise.
public static boolean smallerThan(String version0,
String version1)
version0 - the first versionversion1 - the second version
true if version0 is before version1,
false otherwise.
public static boolean greaterThan(String version0,
String version1)
version0 - the first versionversion1 - the second version
true if version0 is after version1,
false otherwise.public static void main(String... args)
args - les versions
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||