Class KubernetesVersionFactory.KubernetesVersion
- java.lang.Object
-
- io.fabric8.kubernetes.client.utils.KubernetesVersionFactory.Version
-
- io.fabric8.kubernetes.client.utils.KubernetesVersionFactory.KubernetesVersion
-
- All Implemented Interfaces:
Comparable<KubernetesVersionFactory.Version>
- Enclosing class:
- KubernetesVersionFactory
public static class KubernetesVersionFactory.KubernetesVersion extends KubernetesVersionFactory.Version
A kubernetes version. This represents a version that starts with a 'v' followed by a numerical major version. Optionally this may be followed by an 'alpha' or 'beta' qualifier and an also optional numeric minor version.
-
-
Field Summary
Fields Modifier and Type Field Description static KubernetesVersionFactory.VersionFactory<KubernetesVersionFactory.KubernetesVersion>
FACTORY
-
Fields inherited from class io.fabric8.kubernetes.client.utils.KubernetesVersionFactory.Version
full
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(KubernetesVersionFactory.Version other)
Compares this version to another version and returns whether this version has a higher, equal or lower priority than the version that it is being compared to.Integer
getMajor()
Optional<Integer>
getMinor()
Optional<String>
getQualifier()
boolean
isKubernetes()
boolean
isStable()
-
Methods inherited from class io.fabric8.kubernetes.client.utils.KubernetesVersionFactory.Version
getFull, toString
-
-
-
-
Field Detail
-
FACTORY
public static final KubernetesVersionFactory.VersionFactory<KubernetesVersionFactory.KubernetesVersion> FACTORY
-
-
Method Detail
-
getMajor
public Integer getMajor()
-
isStable
public boolean isStable()
-
isKubernetes
public boolean isKubernetes()
- Specified by:
isKubernetes
in classKubernetesVersionFactory.Version
-
compareTo
public int compareTo(KubernetesVersionFactory.Version other)
Compares this version to another version and returns whether this version has a higher, equal or lower priority than the version that it is being compared to. The kubernetes specs v1.17 at Version Priority state the following:- Entries that follow Kubernetes version patterns are sorted before those that do not.
- For entries that follow Kubernetes version patterns, the numeric portions of the version string is sorted largest to smallest.
- If the strings beta or alpha follow the first numeric portion, they sorted in that order, after the equivalent string without the beta or alpha suffix (which is presumed to be the GA version).
- If another number follows the beta, or alpha, those numbers are also sorted from largest to smallest.
- Strings that don’t fit the above format are sorted alphabetically and the numeric portions are not treated specially. Notice that in the example below, foo1 is sorted above foo10. This is different from the sorting of the numeric portion of entries that do follow the Kubernetes version patterns.
- Parameters:
other
- the version to compare this version to- Returns:
- -1 if this version has a lower, 1 if it has a higher or 0 if the priorities are equal
-
-