Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cassandra.utils
Class SemanticVersion

    java.lang.Object
      org.apache.cassandra.utils.SemanticVersion

All Implemented Interfaces:
  java.lang.Comparable<SemanticVersion>

    public class SemanticVersion

extends java.lang.Object
implements java.lang.Comparable<SemanticVersion>

Implements semantic versioning as defined at http://semver.org/. Note: The following code uses a slight variation from the document above in that it doesn't allow dashes in pre-release and build identifier.

Field Summary
`int` | `major`
`int` | `minor`
`int` | `patch`

Constructor Summary
`SemanticVersion(java.lang.String version)` Parse a semantic version from a string.

Method Summary
`int` | `compareTo(SemanticVersion other)`
`boolean` | `equals(java.lang.Object o)`
`SemanticVersion` | `findSupportingVersion(SemanticVersion... versions)` Returns a version that is backward compatible with this version amongst a list of provided version, or null if none can be found.
`int` | `hashCode()`
`boolean` | `isSupportedBy(SemanticVersion version)`
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### major

    public final int major

### minor

    public final int minor

### patch

    public final int patch

Constructor Detail

### SemanticVersion

    public SemanticVersion(java.lang.String version)

  Parse a semantic version from a string.

  Parameters:
    `version` - the string to parse
  Throws:
    `java.lang.IllegalArgumentException` - if the provided string does not represent a semantic version

Method Detail

### compareTo

    public int compareTo(SemanticVersion other)

  Specified by:
    `compareTo` in interface `java.lang.Comparable<SemanticVersion>`

### findSupportingVersion

    public SemanticVersion findSupportingVersion(SemanticVersion... versions)

  Returns a version that is backward compatible with this version amongst a list of provided version, or null if none can be found. For instance: "2.0.0".findSupportingVersion("2.0.0", "3.0.0") == "2.0.0" "2.0.0".findSupportingVersion("2.1.3", "3.0.0") == "2.1.3" "2.0.0".findSupportingVersion("3.0.0") == null "2.0.3".findSupportingVersion("2.0.0") == "2.0.0" "2.1.0".findSupportingVersion("2.0.0") == null

### isSupportedBy

    public boolean isSupportedBy(SemanticVersion version)

### 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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2013 The Apache Software Foundation