public static class MesosNativeLibrary.Version extends java.lang.Object implements java.lang.Comparable<MesosNativeLibrary.Version>
static Version BugFixVersion = new Version(0, 22, 1);
public static void myFunction() {
if (version().compareTo(BugFixVersion) >= 0) {
// New behavior with bug fix.
} else {
// Old behavior for backwards compatibility.
}
}
Constructor and Description |
---|
Version(long major) |
Version(long major,
long minor) |
Version(long major,
long minor,
long patch) |
Modifier and Type | Method and Description |
---|---|
boolean |
after(MesosNativeLibrary.Version other)
A helper that is easier to use than 'compareTo', this returns
true if 'this' version is strictly 'greater than', not 'greater
than or equal to' the 'other' version.
|
boolean |
before(MesosNativeLibrary.Version other)
A helper that is easier to use than 'compareTo', this returns
true if 'this' version is strictly 'less than', not 'less than
or equal to' the 'other' version.
|
int |
compareTo(MesosNativeLibrary.Version other)
Compare this version to an 'other' one.
|
boolean |
equals(MesosNativeLibrary.Version other) |
public final long major
public final long minor
public final long patch
public Version(long major, long minor, long patch)
public Version(long major, long minor)
public Version(long major)
public boolean equals(MesosNativeLibrary.Version other)
public int compareTo(MesosNativeLibrary.Version other)
compareTo
in interface java.lang.Comparable<MesosNativeLibrary.Version>
public boolean before(MesosNativeLibrary.Version other)
public boolean after(MesosNativeLibrary.Version other)