public final class JkVersion extends java.lang.Object implements java.lang.Comparable<JkVersion>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static JkVersion |
UNSPECIFIED
Mention that the version is unspecified
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(JkVersion other) |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getBlock(int index)
If version name is formatted of blocks separated with '.', this methods returns the block at specified index.
|
java.lang.String |
getValue()
Returns the value of the version.
|
boolean |
hasBlockAt(int index)
Returns true when
getBlock(int) won't throws an IllegalArgumentException . |
int |
hashCode() |
boolean |
isDynamic()
Returns
true if the definition stands for a dynamic version
(as "1.4.+", "[1.0,2.0[", "3.0-SNAPSHOT", ...) or false if
it stands for a fixed one (as "1.4.0, "2.0.3-23654114", ...). |
boolean |
isDynamicAndResovable()
Returns
true if the definition stands for dynamic resolvable
version (as 1.4.+, [1.0, 2.0[, ...).Returns false if the version is static or snapshot (as
1.4.0, 3.1-SNAPSHOT) A snapshot is not considered as 'resolvable'. |
boolean |
isGreaterThan(JkVersion other)
Returns
true if this version is to be considered superior to the specified one. |
boolean |
isSnapshot()
Returns
true if this version stands for a snapshot one. |
boolean |
isUnspecified()
Returns
true if this version range is unspecified. |
static JkVersion |
of(java.lang.String name)
Creates a
JkVersion with the specified value. |
java.lang.String |
toString() |
public static final JkVersion UNSPECIFIED
public static JkVersion of(java.lang.String name)
JkVersion
with the specified value. If specified name is null, then it creates
an UNSPECIFIED
version.public java.lang.String getValue()
public boolean isSnapshot()
true
if this version stands for a snapshot one.public int compareTo(JkVersion other)
compareTo
in interface java.lang.Comparable<JkVersion>
public boolean isGreaterThan(JkVersion other)
true
if this version is to be considered superior to the specified one.public boolean isDynamic()
true
if the definition stands for a dynamic version
(as "1.4.+", "[1.0,2.0[", "3.0-SNAPSHOT", ...) or false
if
it stands for a fixed one (as "1.4.0, "2.0.3-23654114", ...).public boolean isUnspecified()
true
if this version range is unspecified.public boolean isDynamicAndResovable()
true
if the definition stands for dynamic resolvable
version (as 1.4.+, [1.0, 2.0[, ...).false
if the version is static or snapshot (as
1.4.0, 3.1-SNAPSHOT) A snapshot is not considered as 'resolvable'.public java.lang.String getBlock(int index)
IllegalArgumentException
if no such block found at specified index.public boolean hasBlockAt(int index)
getBlock(int)
won't throws an IllegalArgumentException
.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object