public int compareTo()

in cassandra-analytics-core/src/main/java/org/apache/cassandra/bridge/CassandraVersionFeatures.java [143:169]


    public int compareTo(@NotNull CassandraVersionFeatures that)
    {
        int difference = this.getMajorVersion() - that.getMajorVersion();
        if (difference != 0)
        {
            return difference;
        }

        difference = this.getMinorVersion() - that.getMinorVersion();
        if (difference != 0)
        {
            return difference;
        }

        // Try to treat suffix as micro version
        try
        {
            return Integer.parseInt(getSuffix()) - Integer.parseInt(that.getSuffix());
        }
        catch (NumberFormatException exception)
        {
            // One with smallest suffix will be smallest
            int thisLength = getSuffix() != null ? getSuffix().length() : 0;
            int thatLength = that.getSuffix() != null ? that.getSuffix().length() : 0;
            return thisLength - thatLength;
        }
    }