Package com.clickhouse.data
Class ClickHouseVersion
java.lang.Object
com.clickhouse.data.ClickHouseVersion
- All Implemented Interfaces:
Serializable,Comparable<ClickHouseVersion>
@Deprecated
public final class ClickHouseVersion
extends Object
implements Comparable<ClickHouseVersion>, Serializable
Deprecated.
Immutable ClickHouse version, which takes the form
Year(Major).Feature(Minor).Maintenance(Patch).Build. Prefix like 'v'
and suffix like '-[testing|stable|lts]' will be ignored in parsing and
comparison.- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClickHouseVersion(boolean latest, int year, int feature, int maintenance, int build) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbelongsTo(ClickHouseVersion version) Deprecated.Checks if the version belongs to the given series.booleanDeprecated.Checks if the version belongs to the given series.booleanDeprecated.Checks if the version is valid according to the given maven-like version range.static booleanDeprecated.Checks if the version is valid according to the given maven-like version range.static intDeprecated.Compares two versions part by part, which is not semantical.intDeprecated.protected intcompareTo(ClickHouseVersion o, boolean sameSeriesComparison) Deprecated.Compares current version and the given one.booleanDeprecated.intDeprecated.Gets build number.intDeprecated.Gets feature release.intDeprecated.Gets maintenance release.intDeprecated.Gets major version in semantic versioning.intDeprecated.Gets minor version in semantic versioning.intgetPatch()Deprecated.Gets patch in semantic versioning.intgetYear()Deprecated.Gets year number.inthashCode()Deprecated.booleanisLatest()Deprecated.Checks if the version is latest or not.booleanisNewerOrEqualTo(ClickHouseVersion version) Deprecated.Checks if the version is newer or equal to the given one.booleanisNewerOrEqualTo(String version) Deprecated.Checks if the version is newer or equal to the given one.booleanisNewerThan(ClickHouseVersion version) Deprecated.Checks if the version is newer than the given one.booleanisNewerThan(String version) Deprecated.Checks if the version is newer than the given one.booleanisOlderOrEqualTo(ClickHouseVersion version) Deprecated.Checks if the version is older or equal to the given one.booleanisOlderOrEqualTo(String version) Deprecated.Checks if the version is older or equal to the given one.booleanisOlderThan(ClickHouseVersion version) Deprecated.Checks if the version is older than the given one.booleanisOlderThan(String version) Deprecated.Checks if the version is older than the given one.static ClickHouseVersionof(int yearOrMajor, int... more) Deprecated.Creates a new version object using given numbers.static ClickHouseVersionDeprecated.Parses the given string to extract version.protected static ClickHouseVersionparseVersion(String version) Deprecated.Parses given version without caching.toString()Deprecated.
-
Constructor Details
-
ClickHouseVersion
protected ClickHouseVersion(boolean latest, int year, int feature, int maintenance, int build) Deprecated.
-
-
Method Details
-
check
Deprecated.Checks if the version is valid according to the given maven-like version range. For examples:21.321.3.x.x, short version of [21.3,21.4)[21.3,21.4)21.3.x.x (included) to 21.4.x.x (not included)[21.3,21.4]21.3.x.x to 21.4.x.x (both included)[21.3,)21.3.x.x or higher(,21.3],[21.8,)to 21.3.x.x (included) and 21.8.x.x or higher
- Parameters:
version- version, null is treated as0.0.0.0range- maven-like version range, null or empty means always invalid- Returns:
- true if the version is valid; false otherwise
-
compare
Deprecated.Compares two versions part by part, which is not semantical. For example:compare("21.3.1", "21.3") > 0, because "21.3.1.0" is greater than "21.3.0.0". However,check("21.3.1", "(,21.3]") == true, since "21.3.1" is considered as part of "21.3" series.- Parameters:
fromVersion- versiontoVersion- version to compare with- Returns:
- positive integer if
fromVersionis newer thantoVersion; zero if they're equal; or negative integer iffromVersionis older
-
of
Deprecated.Parses the given string to extract version. Behind the scene, cache is used to avoid unnecessary overhead.- Parameters:
version- version, null or empty string is treated as0.0.0.0- Returns:
- parsed version
-
of
Deprecated.Creates a new version object using given numbers.- Parameters:
yearOrMajor- year or major vrsionmore- more version numbers if any- Returns:
- version
-
parseVersion
Deprecated.Parses given version without caching.- Parameters:
version- version, null or empty string is treated as0.0.0.0- Returns:
- parsed version
-
compareTo
Deprecated.Compares current version and the given one. WhenincludeEmptyPartsistrue, this method returns 0(instead of 1) when comparing '21.3.1.2' with '21.3', because they're in the same series of '21.3'.- Parameters:
o- the object to be comparedsameSeriesComparison- whether compare if two version are in same series- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object
-
belongsTo
Deprecated.Checks if the version belongs to the given series. For example: 21.3.1.1 belongs to 21.3 series but not 21.4 or 21.3.2.- Parameters:
version- version series, null will be treated as0.0.0.0- Returns:
- true if the version belongs to the given series; false otherwise
-
belongsTo
Deprecated.Checks if the version belongs to the given series. For example: 21.3.1.1 belongs to 21.3 series but not 21.4 or 21.3.2.- Parameters:
version- version series- Returns:
- true if the version belongs to the given series; false otherwise
-
isLatest
public boolean isLatest()Deprecated.Checks if the version is latest or not.- Returns:
- true if it's latest; false otherwise
-
getYear
public int getYear()Deprecated.Gets year number.- Returns:
- year number
-
getFeatureRelease
public int getFeatureRelease()Deprecated.Gets feature release.- Returns:
- feature release
-
getMaintenanceRelease
public int getMaintenanceRelease()Deprecated.Gets maintenance release.- Returns:
- maintenance release
-
getBuilderNumber
public int getBuilderNumber()Deprecated.Gets build number.- Returns:
- build number
-
getMajorVersion
public int getMajorVersion()Deprecated.Gets major version in semantic versioning. Same asgetYear().- Returns:
- major version
-
getMinorVersion
public int getMinorVersion()Deprecated.Gets minor version in semantic versioning. Same asgetFeatureRelease().- Returns:
- minor version
-
getPatch
public int getPatch()Deprecated.Gets patch in semantic versioning. Same agetMaintenanceRelease().- Returns:
- patch
-
isNewerOrEqualTo
Deprecated.Checks if the version is newer or equal to the given one. Pay attention that when comparing "21.3.1.1" to "21.3",compareTo(ClickHouseVersion)says the former is greater, but this method will return false(because 21.3.x.x still belongs to 21.3 series).- Parameters:
version- version to compare- Returns:
- true if the version is newer or equal to the given one; false otherwise
-
isNewerOrEqualTo
Deprecated.Checks if the version is newer or equal to the given one. Pay attention that when comparing "21.3.1.1" to "21.3",compareTo(ClickHouseVersion)says the former is greater, but this method will return false(because 21.3.x.x still belongs to 21.3 series).- Parameters:
version- version to compare- Returns:
- true if the version is newer or equal to the given one; false otherwise
-
isNewerThan
Deprecated.Checks if the version is newer than the given one. Same ascompareTo(version) > 0.- Parameters:
version- version to compare- Returns:
- true if the version is newer than the given one; false otherwise
-
isNewerThan
Deprecated.Checks if the version is newer than the given one. Same ascompareTo(version) > 0.- Parameters:
version- version to compare- Returns:
- true if the version is newer than the given one; false otherwise
-
isOlderOrEqualTo
Deprecated.Checks if the version is older or equal to the given one. Pay attention that when comparing "21.3.1.1" to "21.3",compareTo(ClickHouseVersion)says the former is greater, but this method will return true(because 21.3.x.x still belongs to 21.3 series).- Parameters:
version- version to compare- Returns:
- true if the version is older or equal to the given one; false otherwise
-
isOlderOrEqualTo
Deprecated.Checks if the version is older or equal to the given one. Pay attention that when comparing "21.3.1.1" to "21.3",compareTo(ClickHouseVersion)says the former is greater, but this method will return true(because 21.3.x.x still belongs to 21.3 series).- Parameters:
version- version to compare- Returns:
- true if the version is older or equal to the given one; false otherwise
-
isOlderThan
Deprecated.Checks if the version is older than the given one. Same ascompareTo(version) < 0.- Parameters:
version- version to compare- Returns:
- true if the version is older than the given one; false otherwise
-
isOlderThan
Deprecated.Checks if the version is older than the given one. Same ascompareTo(version) < 0.- Parameters:
version- version to compare- Returns:
- true if the version is older than the given one; false otherwise
-
check
Deprecated.Checks if the version is valid according to the given maven-like version range.- Parameters:
range- version range, null or empty string means always invalid- Returns:
- true if the version is valid; false otherwise
-
compareTo
Deprecated.- Specified by:
compareToin interfaceComparable<ClickHouseVersion>
-
equals
Deprecated. -
hashCode
public int hashCode()Deprecated. -
toString
Deprecated.
-