Class CassandraVersion

  • All Implemented Interfaces:
    java.lang.Comparable<CassandraVersion>

    public class CassandraVersion
    extends java.lang.Object
    implements java.lang.Comparable<CassandraVersion>
    Implements versioning used in Cassandra and CQL.

    Note: The following code uses a slight variation from the semver document (http://semver.org).

    • Field Detail

      • UNREADABLE_VERSION

        public static final CassandraVersion UNREADABLE_VERSION
        Used to indicate that there was a previous version written to the legacy (pre 1.2) system.Versions table, but that we cannot read it. Suffice to say, any upgrade should proceed through 1.2.x before upgrading to the current version.
      • NULL_VERSION

        public static final CassandraVersion NULL_VERSION
        Used to indicate that no previous version information was found. When encountered, we assume that Cassandra was not previously installed and we're in the process of starting a fresh node.
      • major

        public final int major
      • minor

        public final int minor
      • patch

        public final int patch
      • hotfix

        public final int hotfix
      • familyLowerBound

        public final java.util.function.Supplier<CassandraVersion> familyLowerBound
    • Constructor Detail

      • CassandraVersion

        public CassandraVersion​(java.lang.String version)
        Parse a version from a string.
        Parameters:
        version - the string to parse
        Throws:
        java.lang.IllegalArgumentException - if the provided string does not represent a version
    • Method Detail

      • getPreRelease

        public java.util.List<java.lang.String> getPreRelease()
      • getBuild

        public java.util.List<java.lang.String> getBuild()
      • compareTo

        public int compareTo​(CassandraVersion other,
                             boolean compareToPatchOnly)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toMajorMinorString

        public java.lang.String toMajorMinorString()