Class Version
- java.lang.Object
-
- com.github.nosan.embedded.cassandra.Version
-
- All Implemented Interfaces:
Comparable<Version>
public final class Version extends Object implements Comparable<Version>
A representation of a Cassandra version.- Since:
- 4.0.0
- Author:
- Dmytro Nosan
- See Also:
parse(String)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Version other)booleanequals(Object other)Optional<String>getLabel()Retrieves the pre-release label, if available.intgetMajor()Retrieves the major version.intgetMinor()Retrieves the minor version.OptionalIntgetPatch()Retrieves the patch version, if available.inthashCode()static Versionparse(String version)Creates aVersionfrom a textual representation, such as4.0.StringtoString()
-
-
-
Method Detail
-
parse
public static Version parse(String version) throws IllegalArgumentException
Creates aVersionfrom a textual representation, such as4.0.- Parameters:
version- the version to parse- Returns:
- the parsed
Version - Throws:
IllegalArgumentException- if the version is invalid
-
getMajor
public int getMajor()
Retrieves the major version.- Returns:
- the major version
-
getMinor
public int getMinor()
Retrieves the minor version.- Returns:
- the minor version
-
getPatch
public OptionalInt getPatch()
Retrieves the patch version, if available.- Returns:
- an
OptionalIntcontaining the patch version, or an emptyOptionalIntif not present
-
getLabel
public Optional<String> getLabel()
Retrieves the pre-release label, if available.- Returns:
- an
Optionalcontaining the label, or an emptyOptionalif not present
-
compareTo
public int compareTo(Version other)
- Specified by:
compareToin interfaceComparable<Version>
-
-