Version

public class Version implements Comparable<Version>

Fields

VERSION_COMPARATOR

public static final Comparator<Version> VERSION_COMPARATOR

ZERO

public static final Version ZERO

incrementableFields

public static final EnumSet<FIELD> incrementableFields

Methods

compareTo

public int compareTo(Version that)

equals

public boolean equals(Object o)

getBaseVersion

public Version getBaseVersion()

getBugfix

public int getBugfix()

getBuild

public int getBuild()

getCommit

public String getCommit()

getMajor

public int getMajor()

getMinor

public int getMinor()

getTypeNumber

public int getTypeNumber()

getVersionType

public TYPE getVersionType()

hashCode

public int hashCode()

increment

public Version increment(FIELD field, int amount)

Method increments given field by the specified amount

Parameters:
  • field – to be incremented - only incrementable fields are supported, i.e. any of the Version.incrementableFields.
  • amount – by which version should be incremented
Returns:

incremented version if correct field was passed as argument, otherwise same non-incremented version is returned.

isZero

public boolean isZero()

of

public static Version of(String str)

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
Throws:
Returns:

a Version object based on the provided string.

toString

public String toString()

toString

public String toString(int padding)