Class VersionUtils

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

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

    Constructors
    Constructor Description
    VersionUtils()  
  • Method Summary

    Modifier and Type Method Description
    static java.util.List<org.elasticsearch.Version> allReleasedVersions()
    Returns an immutable, sorted list containing all released versions.
    static java.util.List<org.elasticsearch.Version> allUnreleasedVersions()
    Returns an immutable, sorted list containing all unreleased versions.
    static java.util.List<org.elasticsearch.Version> allVersions()
    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 getFirstVersion()
    Returns the oldest released Version
    static org.elasticsearch.Version getPreviousMinorVersion()
    Returns the released Version before the Version.CURRENT where the minor version is less than the currents minor version.
    static org.elasticsearch.Version getPreviousVersion()
    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 incompatibleFutureVersion​(org.elasticsearch.Version version)
    returns the first future incompatible 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​(java.util.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 randomIndexCompatibleVersion​(java.util.Random random)
    Returns a random version index compatible with the current version.
    static org.elasticsearch.Version randomVersion​(java.util.Random random)
    Returns a random Version from all available versions.
    static org.elasticsearch.Version randomVersionBetween​(java.util.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 java.util.List<org.elasticsearch.Version> allReleasedVersions()
      Returns an immutable, sorted list containing all released versions.
    • allUnreleasedVersions

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

      public static java.util.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​(java.util.Random random)
      Returns a random Version from all available versions.
    • randomCompatibleVersion

      public static org.elasticsearch.Version randomCompatibleVersion​(java.util.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​(java.util.Random random, @Nullable org.elasticsearch.Version minVersion, @Nullable org.elasticsearch.Version maxVersion)
      Returns a random Version between minVersion and maxVersion (inclusive).
    • incompatibleFutureVersion

      public static org.elasticsearch.Version incompatibleFutureVersion​(org.elasticsearch.Version version)
      returns the first future incompatible version
    • 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​(java.util.Random random)
      Returns a random version index compatible with the current version.