|
Qwylt | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.module.Version
public class Version
A canonical, syntax agnostic version number type that supports ordered comparison.
Instances may contain any number of positive numeric components and an optional 'preview' or 'update' string qualifier. An unqualified instance is considered a 'release' version. Qualifier strings may contain any of the posix visible characters (i.e. '!' through 'n'). During comparison:
| Nested Class Summary | |
|---|---|
static class |
Version.Type
|
| Field Summary | |
|---|---|
static Version |
MAX_VALUE
An instance of the maximum value. |
static Version |
MIN_VALUE
An instance of the minimum value. |
static Version |
ZERO
An instance of the release version zero. |
| Method Summary | |
|---|---|
int |
compareTo(Version version)
Compare two Version objects. |
boolean |
equals(java.lang.Object obj)
Compare two Version objects for equality. |
int |
getComponentAt(int index)
Return the component at the specified index. |
int |
getComponentCount()
Returns the number of components in this instance. |
java.lang.String |
getQualifier()
Returns the qualifier, if any. |
Version.Type |
getType()
Returns the type of this instance. |
int |
hashCode()
Returns a hash code for this Version. |
boolean |
matches(Version version)
Tests if the specified version is equal to this instance. |
static Version |
newPreviewVersion(int[] components,
java.lang.String qualifier)
Create a new PREVIEW version. |
static Version |
newReleaseVersion(int... components)
Create a new RELEASE version. |
static Version |
newUpdateVersion(int[] components,
java.lang.String qualifier)
Create a new UPDATE version. |
static Version |
newVersion(Version.Type type,
int[] components,
java.lang.String qualifier)
Create a new version. |
java.lang.String |
toString()
Returns a String object representing this Version's
value, in canonical form. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Version MIN_VALUE
public static final Version MAX_VALUE
public static Version ZERO
| Method Detail |
|---|
public static Version newPreviewVersion(int[] components,
java.lang.String qualifier)
components - The components.qualifier - The qualifier.
public static Version newReleaseVersion(int... components)
components - The components.
public static Version newUpdateVersion(int[] components,
java.lang.String qualifier)
components - The components.qualifier - The qualifier.
public static Version newVersion(Version.Type type,
int[] components,
java.lang.String qualifier)
type - The type.components - The components.qualifier - The qualifier. Must be null if type == RELEASE, otherwise
must be non-zero length.
public Version.Type getType()
public int getComponentCount()
public int getComponentAt(int index)
index - The index.
java.lang.IndexOutOfBoundsException - if index is out of bounds.public java.lang.String getQualifier()
public int compareTo(Version version)
Version objects.
compareTo in interface java.lang.Comparable<Version>version - the Version to be compared.
Version is equal to the
Version argument; a value less than 0 if this
Version is less than the Version argument; and a
value greater than 0 if this Version is greater than the
Version argument.public boolean equals(java.lang.Object obj)
Version objects for equality. The result is
true if and only if the argument is not null and is a
Version object for which compareTo() returns 0.
equals in class java.lang.Objectobj - the object to compare with.
Version objects are equal.public int hashCode()
Version.
hashCode in class java.lang.ObjectVersion.public java.lang.String toString()
String object representing this Version's
value, in canonical form.
toString in class java.lang.ObjectVersion in
canonical form.public boolean matches(Version version)
matches in interface Matcher<Version>version - The target version.
true if the specified version is equal to this instance;
false otherwise.
|
Qwylt | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||