@InternalApi public final class DatabricksCliVersion extends Object implements Comparable<DatabricksCliVersion>
Three sentinel states in the (major, minor, patch) tuple:
(-1, -1, -1) — the UNKNOWN sentinel, meaning version detection failed. It
compares less than every real release so every feature gate fails.
(0, 0, 0) — the CLI's default dev build, emitted when the binary was built without
version metadata. See isDefaultDevBuild().
Prerelease tags are deliberately ignored: feature gates are release-based, so a prerelease of a version with a flag is assumed to have the flag too.
| Modifier and Type | Field and Description |
|---|---|
static DatabricksCliVersion |
DEFAULT_DEV_BUILD
Default dev build sentinel — emitted when the CLI was built without version metadata.
|
static DatabricksCliVersion |
UNKNOWN |
| Modifier and Type | Method and Description |
|---|---|
boolean |
atLeast(DatabricksCliVersion other)
Returns true when
this is greater than or equal to other. |
int |
compareTo(DatabricksCliVersion o) |
boolean |
equals(Object o) |
int |
getMajor() |
int |
getMinor() |
int |
getPatch() |
int |
hashCode() |
boolean |
isDefaultDevBuild()
Returns true when the version is the CLI's
DEFAULT_DEV_BUILD sentinel. |
String |
toString() |
public static final DatabricksCliVersion UNKNOWN
public static final DatabricksCliVersion DEFAULT_DEV_BUILD
public int getMajor()
public int getMinor()
public int getPatch()
public boolean atLeast(DatabricksCliVersion other)
this is greater than or equal to other.public boolean isDefaultDevBuild()
DEFAULT_DEV_BUILD sentinel. A CLI built
without version metadata leaves these fields at their zero defaults.public int compareTo(DatabricksCliVersion o)
compareTo in interface Comparable<DatabricksCliVersion>Copyright © 2026. All rights reserved.