Package h07.util
Class Updater.Version
- java.lang.Object
-
- h07.util.Updater.Version
-
- All Implemented Interfaces:
Comparable<Updater.Version>
- Enclosing class:
- Updater
private static class Updater.Version extends Object implements Comparable<Updater.Version>
A limited implementation of Semantic Versioning.
This class can handle major, minor and patch versions and compare them.
-
-
Field Summary
Fields Modifier and Type Field Description private int
MAJOR_VERSION
The major version of the version represented by an instance of this classprivate int
MINOR_VERSION
The minor version of the version represented by an instance of this classprivate int
PATCH_VERSION
The patch version of the version represented by an instance of this class
-
Constructor Summary
Constructors Modifier Constructor Description private
Version(String version)
Creates a newUpdater.Version
representing the given version string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Updater.Version version)
Compares thisUpdater.Version
object with the specifiedUpdater.Version
object for orderString
toString()
Returns thisUpdater.Version
object's string representation
-
-
-
Field Detail
-
MAJOR_VERSION
private final int MAJOR_VERSION
The major version of the version represented by an instance of this class
-
MINOR_VERSION
private final int MINOR_VERSION
The minor version of the version represented by an instance of this class
-
PATCH_VERSION
private final int PATCH_VERSION
The patch version of the version represented by an instance of this class
-
-
Constructor Detail
-
Version
private Version(String version)
Creates a newUpdater.Version
representing the given version string.- Parameters:
version
- The version as aString
, e.g., "1.0.0".
-
-
Method Detail
-
compareTo
public int compareTo(Updater.Version version)
Compares thisUpdater.Version
object with the specifiedUpdater.Version
object for order- Specified by:
compareTo
in interfaceComparable<Updater.Version>
- Parameters:
version
- TheUpdater.Version
object to compare.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object
-
toString
public String toString()
Returns thisUpdater.Version
object's string representation
-
-