public class Version extends Object implements Comparable<Version>
Modifier and Type | Class and Description |
---|---|
static class |
Version.Builder |
static class |
Version.FIELD |
static class |
Version.TYPE |
Modifier and Type | Field and Description |
---|---|
static EnumSet<Version.FIELD> |
incrementableFields |
static Comparator<Version> |
VERSION_COMPARATOR |
static Version |
ZERO |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Version that) |
boolean |
equals(Object o) |
Version |
getBaseVersion() |
int |
getBugfix() |
int |
getBuild() |
String |
getCommit() |
int |
getMajor() |
int |
getMinor() |
int |
getTypeNumber() |
Version.TYPE |
getVersionType() |
int |
hashCode() |
Version |
increment(Version.FIELD field,
int amount)
Method increments given field by the specified amount
|
boolean |
isZero() |
static Version |
of(String str)
Supports both tigase-server-7.2.0-SNAPSHOT-b4895-dist-max.tar.gz and version strings
|
String |
toString() |
String |
toString(int padding) |
public static final EnumSet<Version.FIELD> incrementableFields
public static final Comparator<Version> VERSION_COMPARATOR
public static final Version ZERO
public static Version of(String str) throws IllegalArgumentException
str
- string to be parsed. Must match the supported formatsIllegalArgumentException
- when provided input doesn't match supported formatspublic int compareTo(Version that)
compareTo
in interface Comparable<Version>
public Version getBaseVersion()
public int getBugfix()
public int getBuild()
public String getCommit()
public int getMajor()
public int getMinor()
public int getTypeNumber()
public Version.TYPE getVersionType()
public Version increment(Version.FIELD field, int amount) throws IllegalArgumentException
field
- to be incremented - only incrementable fields are supported, i.e. any of the incrementableFields
.amount
- by which version should be incrementedIllegalArgumentException
public boolean isZero()
public String toString(int padding)
Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.