Class VersionUtils

java.lang.Object
org.elasticsearch.test.VersionUtils

public class VersionUtils extends Object
Utilities for selecting versions in tests
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<org.elasticsearch.Version>
    Returns an immutable, sorted list containing all released versions.
    static List<org.elasticsearch.Version>
    Returns an immutable, sorted list containing all unreleased versions.
    static List<org.elasticsearch.Version>
    Returns an immutable, sorted list containing all versions, both released and unreleased.
    static org.elasticsearch.Version
    compatibleFutureVersion(org.elasticsearch.Version version)
    returns the first future compatible version
    static org.elasticsearch.Version
    Returns the oldest released Version
    static org.elasticsearch.Version
    Returns the released Version before the Version.CURRENT where the minor version is less than the currents minor version.
    static org.elasticsearch.Version
    Get the released version before Version.CURRENT.
    static org.elasticsearch.Version
    getPreviousVersion(org.elasticsearch.Version version)
    Get the released version before version.
    static org.elasticsearch.Version
    maxCompatibleVersion(org.elasticsearch.Version version)
    Returns the maximum Version that is compatible with the given version.
    static org.elasticsearch.Version
    randomCompatibleVersion(Random random, org.elasticsearch.Version version)
    Returns a random Version from all available versions, that is compatible with the given version.
    static org.elasticsearch.Version
    Returns a random version index compatible with the current version.
    static org.elasticsearch.Version
    randomPreviousCompatibleVersion(Random random, org.elasticsearch.Version version)
    Returns a random version index compatible with the given version, but not the given version.
    static org.elasticsearch.Version
    Returns a random Version from all available versions.
    static org.elasticsearch.Version
    randomVersionBetween(Random random, org.elasticsearch.Version minVersion, org.elasticsearch.Version maxVersion)
    Returns a random Version between minVersion and maxVersion (inclusive).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VersionUtils

      public VersionUtils()
  • Method Details

    • allReleasedVersions

      public static List<org.elasticsearch.Version> allReleasedVersions()
      Returns an immutable, sorted list containing all released versions.
    • allUnreleasedVersions

      public static List<org.elasticsearch.Version> allUnreleasedVersions()
      Returns an immutable, sorted list containing all unreleased versions.
    • allVersions

      public static List<org.elasticsearch.Version> allVersions()
      Returns an immutable, sorted list containing all versions, both released and unreleased.
    • getPreviousVersion

      public static org.elasticsearch.Version getPreviousVersion(org.elasticsearch.Version version)
      Get the released version before version.
    • getPreviousVersion

      public static org.elasticsearch.Version getPreviousVersion()
      Get the released version before Version.CURRENT.
    • getPreviousMinorVersion

      public static org.elasticsearch.Version getPreviousMinorVersion()
      Returns the released Version before the Version.CURRENT where the minor version is less than the currents minor version.
    • getFirstVersion

      public static org.elasticsearch.Version getFirstVersion()
      Returns the oldest released Version
    • randomVersion

      public static org.elasticsearch.Version randomVersion(Random random)
      Returns a random Version from all available versions.
    • randomCompatibleVersion

      public static org.elasticsearch.Version randomCompatibleVersion(Random random, org.elasticsearch.Version version)
      Returns a random Version from all available versions, that is compatible with the given version.
    • randomVersionBetween

      public static org.elasticsearch.Version randomVersionBetween(Random random, @Nullable org.elasticsearch.Version minVersion, @Nullable org.elasticsearch.Version maxVersion)
      Returns a random Version between minVersion and maxVersion (inclusive).
    • compatibleFutureVersion

      public static org.elasticsearch.Version compatibleFutureVersion(org.elasticsearch.Version version)
      returns the first future compatible version
    • maxCompatibleVersion

      public static org.elasticsearch.Version maxCompatibleVersion(org.elasticsearch.Version version)
      Returns the maximum Version that is compatible with the given version.
    • randomIndexCompatibleVersion

      public static org.elasticsearch.Version randomIndexCompatibleVersion(Random random)
      Returns a random version index compatible with the current version.
    • randomPreviousCompatibleVersion

      public static org.elasticsearch.Version randomPreviousCompatibleVersion(Random random, org.elasticsearch.Version version)
      Returns a random version index compatible with the given version, but not the given version.