Package tigase.util
Class Version
java.lang.Object
tigase.util.Version
- All Implemented Interfaces:
Comparable<Version>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static enum
static enum
-
Field Summary
Modifier and TypeFieldDescriptionstatic final EnumSet<Version.FIELD>
static final Comparator<Version>
static final Version
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
int
int
getBuild()
int
getMajor()
int
getMinor()
int
int
hashCode()
increment
(Version.FIELD field, int amount) Method increments given field by the specified amountboolean
isZero()
static Version
Supports both tigase-server-7.2.0-SNAPSHOT-b4895-dist-max.tar.gz and version stringstoString()
toString
(int padding)
-
Field Details
-
incrementableFields
-
VERSION_COMPARATOR
-
ZERO
-
-
Method Details
-
of
Supports both tigase-server-7.2.0-SNAPSHOT-b4895-dist-max.tar.gz and version strings- Parameters:
str
- string to be parsed. Must match the supported formats- Returns:
- a Version object based on the provided string.
- Throws:
IllegalArgumentException
- when provided input doesn't match supported formats
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Version>
-
equals
-
getBaseVersion
-
getBugfix
public int getBugfix() -
getBuild
public int getBuild() -
getCommit
-
getMajor
public int getMajor() -
getMinor
public int getMinor() -
getTypeNumber
public int getTypeNumber() -
getVersionType
-
hashCode
public int hashCode() -
increment
Method increments given field by the specified amount- Parameters:
field
- to be incremented - only incrementable fields are supported, i.e. any of theincrementableFields
.amount
- by which version should be incremented- Returns:
- incremented version if correct field was passed as argument, otherwise same non-incremented version is returned.
- Throws:
IllegalArgumentException
-
isZero
public boolean isZero() -
toString
-
toString
-