@Deprecated public class Version extends Object implements Comparable<Version>, Serializable
A class to represent a version.
Replace previously org.nuiton.util.Version class.
componants separated by componantSeparator.
Componant separator are characters which can't be alphanumeric and can be empty character.
Componant separators are optional and componants will be detected as soon as a character changed from a numeric string sequence to a alpha (none numeric!) sequence.
For example, version 1a2 is composed of three componants: {code 1}, a and 3.
SNAPSHOT (see below section about ordering).
0 (one componant 0) 0-SNAPSHOT (one componant 0 + SNAPSHOT flag) 1.0 (two componants 1,0) 1.1 (two componants 1,1) 1.1-alpha-1 (four componants 1,1,alpha,1) 1.1-beta (three componants 1,1,beta) 1.1-rc-1 (four componants 1,1,rc,1) 1.1-a (three componants 1,1,a) 1.1-a12-4.45_6432 (seven componants 1,1,a,12,4,45,643)
VersionComparator.
VersionBuilder API
or shortcut methods in Versions.VersionBuilder,
VersionComparator,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
Version.NumberVersionComponant
Deprecated.
|
static class |
Version.StringVersionComponant
Deprecated.
|
static interface |
Version.VersionComponant<C extends Comparable<C>,V extends Version.VersionComponant>
Deprecated.
|
| Modifier and Type | Field and Description |
|---|---|
protected List<Version.VersionComponant> |
componants
Deprecated.
List of componants of the version.
|
protected List<String> |
componantSeparators
Deprecated.
List of separators of the version.
|
static char |
DEFAULT_JOIN_COMPONANT_SEPARATOR
Deprecated.
|
protected boolean |
snapshot
Deprecated.
flag to define if version is a snapshot (if so a -SNAPSHOT is
added at the end of the textual representation of the version).
|
static String |
SNAPSHOT_SUFFIX
Deprecated.
Suffix of a
SNAPSHOT version in the text representation. |
protected String |
version
Deprecated.
string represention of the version.
|
protected static VersionComparator |
VERSION_COMPARATOR
Deprecated.
Comparator of version used internaly to fulfill the compoarator contract.
|
static Version |
VZERO
Deprecated.
Version V0.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Version(List<Version.VersionComponant> componants,
List<String> componantSeparators,
boolean snapshot)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
after(Version o)
Deprecated.
|
boolean |
afterOrEquals(Version o)
Deprecated.
|
boolean |
before(Version o)
Deprecated.
|
boolean |
beforeOrequals(Version o)
Deprecated.
|
int |
compareTo(Version o)
Deprecated.
|
Version |
decrements(int componantPosition)
Deprecated.
use
Versions.decrements(Version, int) instead |
boolean |
equals(Object o)
Deprecated.
|
Version.VersionComponant |
getComponant(int level)
Deprecated.
|
int |
getComponantCount()
Deprecated.
|
List<Version.VersionComponant> |
getComponants()
Deprecated.
|
List<String> |
getComponantSeparators()
Deprecated.
|
protected Version.VersionComponant |
getLastComponant()
Deprecated.
|
int |
getNumberComponant(int componantPosition)
Deprecated.
|
String |
getTextComponant(int componantPosition)
Deprecated.
|
String |
getValidName()
Deprecated.
Convert the string representation to a java identifier compliant.
|
String |
getVersion()
Deprecated.
|
int |
hashCode()
Deprecated.
|
Version |
increments()
Deprecated.
use instead
Versions.increments(Version) |
Version |
increments(char componantSeperator)
Deprecated.
use instead
Versions.increments(Version, char) |
Version |
increments(int componantPosition)
Deprecated.
use instead
Versions.increments(Version, int) |
boolean |
isSnapshot()
Deprecated.
|
String |
toString()
Deprecated.
|
public static final String SNAPSHOT_SUFFIX
SNAPSHOT version in the text representation.public static final Version VZERO
protected static final VersionComparator VERSION_COMPARATOR
public static final char DEFAULT_JOIN_COMPONANT_SEPARATOR
protected final List<Version.VersionComponant> componants
protected final List<String> componantSeparators
protected final boolean snapshot
protected transient String version
protected Version(List<Version.VersionComponant> componants, List<String> componantSeparators, boolean snapshot)
public List<Version.VersionComponant> getComponants()
public boolean isSnapshot()
public int getComponantCount()
public int getNumberComponant(int componantPosition)
public String getTextComponant(int componantPosition)
public Version.VersionComponant getComponant(int level)
public String getVersion()
public String getValidName()
. is forbidden. is forbidden_ character.@Deprecated public Version increments()
Versions.increments(Version)@Deprecated public Version increments(char componantSeperator)
Versions.increments(Version, char)componantSeperator - the componant separator to use the last componant is a classifier@Deprecated public Version increments(int componantPosition)
Versions.increments(Version, int)componantPosition - position of the version componant to increment@Deprecated public Version decrements(int componantPosition)
Versions.decrements(Version, int) insteadcomponantPosition - position of the version componant to incrementpublic int compareTo(Version o)
compareTo in interface Comparable<Version>public boolean beforeOrequals(Version o)
o - the other version to testtrue if current version is before or equals the given onepublic boolean before(Version o)
o - the other version to testtrue if current version is before the given onepublic boolean afterOrEquals(Version o)
o - the other version to testtrue if current version is after or equals the given onepublic boolean after(Version o)
o - the other version to testtrue if current version is after the given oneprotected Version.VersionComponant getLastComponant()
Copyright © 2004–2017 CodeLutin. All rights reserved.