Package com.franz.agraph.repository
Class AGServerVersion
java.lang.Object
com.franz.agraph.repository.AGServerVersion
- All Implemented Interfaces:
Comparable<AGServerVersion>
AllegroGraph server version number.
A version is constructed from string containing a sequence of numbers
separated by non-digit characters.
The main purpose of this class is to allow version numbers to be compared.
Note that only numeric components are compared, all other characters
are ignored. All trailing zeros are stripped, so version "6.0.0" is
considered to be equal to "6" and "6.0".
-
Constructor Summary
ConstructorDescriptionAGServerVersion
(String versionString) Parses a version string and constructs a version object. -
Method Summary
-
Constructor Details
-
AGServerVersion
Parses a version string and constructs a version object.- Parameters:
versionString
- String to be parsed, must consist of a sequence of numbers separated by non-digit characters,
-
-
Method Details
-
compareTo
Performs a lexicographic comparison with another version number. Note that only numerical components are considered, all other characters from the original version strings are ignored. Any trailing zeros are also ignored, so "6.0" will be considered equal to "6.0.0" and "6".- Specified by:
compareTo
in interfaceComparable<AGServerVersion>
- Parameters:
other
- The version to compare with.- Returns:
- See
Comparable.compareTo(Object)
- Throws:
NullPointerException
- if the other version is null.
-
equals
Checks if another object represents the same version number. Note that only numerical components are considered, all other characters from the original version strings are ignored. Any trailing zeros are also ignored, so "6.0" will be considered equal to "6.0.0" and "6". If the other object is null or not an AGServerVersion false will be returned. -
hashCode
public int hashCode() -
toString
-