Package org.elasticsearch.test
Class VersionUtils
java.lang.Object
org.elasticsearch.test.VersionUtils
Utilities for selecting versions in tests
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic NavigableSet
<Version> Returns an immutable, sorted list containing all versions, both released and unreleased.static Version
Returns the oldestVersion
static Version
Returns theVersion
before theVersion.CURRENT
where the minor version is less than the currents minor version.static Version
Get the released version beforeVersion.CURRENT
.static Version
getPreviousVersion
(Version version) Get the version beforeversion
.static Version
maxCompatibleVersion
(Version version) Returns the maximumVersion
that is compatible with the given version.static Version
randomCompatibleVersion
(Random random, Version version) Returns a randomVersion
from all available versions, that is compatible with the given version.static <T extends VersionId<T>>
TrandomFrom
(Random random, NavigableSet<T> set, IntFunction<T> ctor) static Version
randomVersion
(Random random) Returns a randomVersion
from all available versions.static Version
randomVersionBetween
(Random random, Version minVersion, Version maxVersion)
-
Constructor Details
-
VersionUtils
public VersionUtils()
-
-
Method Details
-
allVersions
Returns an immutable, sorted list containing all versions, both released and unreleased. -
getPreviousVersion
Get the version beforeversion
. -
getPreviousVersion
Get the released version beforeVersion.CURRENT
. -
getPreviousMinorVersion
Returns theVersion
before theVersion.CURRENT
where the minor version is less than the currents minor version. -
getFirstVersion
Returns the oldestVersion
-
randomVersion
Returns a randomVersion
from all available versions. -
randomCompatibleVersion
Returns a randomVersion
from all available versions, that is compatible with the given version. -
randomVersionBetween
-
maxCompatibleVersion
Returns the maximumVersion
that is compatible with the given version.
-