Class Version

All Implemented Interfaces:
Comparable<Version>, ToXContent, ToXContentFragment

public class Version extends Object implements Comparable<Version>, ToXContentFragment
  • Field Details

    • V_EMPTY_ID

      public static final int V_EMPTY_ID
      See Also:
    • V_EMPTY

      public static final Version V_EMPTY
    • V_6_0_0_alpha1

      public static final Version V_6_0_0_alpha1
    • V_6_0_0_alpha2

      public static final Version V_6_0_0_alpha2
    • V_6_0_0_beta1

      public static final Version V_6_0_0_beta1
    • V_6_0_0_beta2

      public static final Version V_6_0_0_beta2
    • V_6_0_0_rc1

      public static final Version V_6_0_0_rc1
    • V_6_0_0_rc2

      public static final Version V_6_0_0_rc2
    • V_6_0_0

      public static final Version V_6_0_0
    • V_6_0_1

      public static final Version V_6_0_1
    • V_6_1_0

      public static final Version V_6_1_0
    • V_6_1_1

      public static final Version V_6_1_1
    • V_6_1_2

      public static final Version V_6_1_2
    • V_6_1_3

      public static final Version V_6_1_3
    • V_6_1_4

      public static final Version V_6_1_4
    • V_6_2_0

      public static final Version V_6_2_0
    • V_6_2_1

      public static final Version V_6_2_1
    • V_6_2_2

      public static final Version V_6_2_2
    • V_6_2_3

      public static final Version V_6_2_3
    • V_6_2_4

      public static final Version V_6_2_4
    • V_6_3_0

      public static final Version V_6_3_0
    • V_6_3_1

      public static final Version V_6_3_1
    • V_6_3_2

      public static final Version V_6_3_2
    • V_6_4_0

      public static final Version V_6_4_0
    • V_6_4_1

      public static final Version V_6_4_1
    • V_6_4_2

      public static final Version V_6_4_2
    • V_6_4_3

      public static final Version V_6_4_3
    • V_6_5_0

      public static final Version V_6_5_0
    • V_6_5_1

      public static final Version V_6_5_1
    • V_6_5_2

      public static final Version V_6_5_2
    • V_6_5_3

      public static final Version V_6_5_3
    • V_6_5_4

      public static final Version V_6_5_4
    • V_6_6_0

      public static final Version V_6_6_0
    • V_6_6_1

      public static final Version V_6_6_1
    • V_6_6_2

      public static final Version V_6_6_2
    • V_6_7_0

      public static final Version V_6_7_0
    • V_6_7_1

      public static final Version V_6_7_1
    • V_6_7_2

      public static final Version V_6_7_2
    • V_6_8_0

      public static final Version V_6_8_0
    • V_6_8_1

      public static final Version V_6_8_1
    • V_6_8_2

      public static final Version V_6_8_2
    • V_6_8_3

      public static final Version V_6_8_3
    • V_6_8_4

      public static final Version V_6_8_4
    • V_6_8_5

      public static final Version V_6_8_5
    • V_6_8_6

      public static final Version V_6_8_6
    • V_6_8_7

      public static final Version V_6_8_7
    • V_6_8_8

      public static final Version V_6_8_8
    • V_6_8_9

      public static final Version V_6_8_9
    • V_6_8_10

      public static final Version V_6_8_10
    • V_6_8_11

      public static final Version V_6_8_11
    • V_6_8_12

      public static final Version V_6_8_12
    • V_6_8_13

      public static final Version V_6_8_13
    • V_6_8_14

      public static final Version V_6_8_14
    • V_6_8_15

      public static final Version V_6_8_15
    • V_6_8_16

      public static final Version V_6_8_16
    • V_6_8_17

      public static final Version V_6_8_17
    • V_6_8_18

      public static final Version V_6_8_18
    • V_6_8_19

      public static final Version V_6_8_19
    • V_6_8_20

      public static final Version V_6_8_20
    • V_6_8_21

      public static final Version V_6_8_21
    • V_6_8_22

      public static final Version V_6_8_22
    • V_6_8_23

      public static final Version V_6_8_23
    • V_6_8_24

      public static final Version V_6_8_24
    • V_7_0_0

      public static final Version V_7_0_0
    • V_7_0_1

      public static final Version V_7_0_1
    • V_7_1_0

      public static final Version V_7_1_0
    • V_7_1_1

      public static final Version V_7_1_1
    • V_7_2_0

      public static final Version V_7_2_0
    • V_7_2_1

      public static final Version V_7_2_1
    • V_7_3_0

      public static final Version V_7_3_0
    • V_7_3_1

      public static final Version V_7_3_1
    • V_7_3_2

      public static final Version V_7_3_2
    • V_7_4_0

      public static final Version V_7_4_0
    • V_7_4_1

      public static final Version V_7_4_1
    • V_7_4_2

      public static final Version V_7_4_2
    • V_7_5_0

      public static final Version V_7_5_0
    • V_7_5_1

      public static final Version V_7_5_1
    • V_7_5_2

      public static final Version V_7_5_2
    • V_7_6_0

      public static final Version V_7_6_0
    • V_7_6_1

      public static final Version V_7_6_1
    • V_7_6_2

      public static final Version V_7_6_2
    • V_7_7_0

      public static final Version V_7_7_0
    • V_7_7_1

      public static final Version V_7_7_1
    • V_7_8_0

      public static final Version V_7_8_0
    • V_7_8_1

      public static final Version V_7_8_1
    • V_7_9_0

      public static final Version V_7_9_0
    • V_7_9_1

      public static final Version V_7_9_1
    • V_7_9_2

      public static final Version V_7_9_2
    • V_7_9_3

      public static final Version V_7_9_3
    • V_7_10_0

      public static final Version V_7_10_0
    • V_7_10_1

      public static final Version V_7_10_1
    • V_7_10_2

      public static final Version V_7_10_2
    • V_7_11_0

      public static final Version V_7_11_0
    • V_7_11_1

      public static final Version V_7_11_1
    • V_7_11_2

      public static final Version V_7_11_2
    • V_7_12_0

      public static final Version V_7_12_0
    • V_7_12_1

      public static final Version V_7_12_1
    • V_7_13_0

      public static final Version V_7_13_0
    • V_7_13_1

      public static final Version V_7_13_1
    • V_7_13_2

      public static final Version V_7_13_2
    • V_7_13_3

      public static final Version V_7_13_3
    • V_7_13_4

      public static final Version V_7_13_4
    • V_7_14_0

      public static final Version V_7_14_0
    • V_7_14_1

      public static final Version V_7_14_1
    • V_7_14_2

      public static final Version V_7_14_2
    • V_7_15_0

      public static final Version V_7_15_0
    • V_7_15_1

      public static final Version V_7_15_1
    • V_7_15_2

      public static final Version V_7_15_2
    • V_7_16_0

      public static final Version V_7_16_0
    • V_7_16_1

      public static final Version V_7_16_1
    • V_7_16_2

      public static final Version V_7_16_2
    • V_7_16_3

      public static final Version V_7_16_3
    • V_7_17_0

      public static final Version V_7_17_0
    • V_7_17_1

      public static final Version V_7_17_1
    • V_7_17_2

      public static final Version V_7_17_2
    • V_7_17_3

      public static final Version V_7_17_3
    • V_7_17_4

      public static final Version V_7_17_4
    • V_7_17_5

      public static final Version V_7_17_5
    • V_7_17_6

      public static final Version V_7_17_6
    • V_7_17_7

      public static final Version V_7_17_7
    • V_7_17_8

      public static final Version V_7_17_8
    • V_7_17_9

      public static final Version V_7_17_9
    • V_7_17_10

      public static final Version V_7_17_10
    • V_7_17_11

      public static final Version V_7_17_11
    • V_7_17_12

      public static final Version V_7_17_12
    • V_7_17_13

      public static final Version V_7_17_13

      public static final Version CURRENT
    • id

      public final int id
    • major

      public final byte major
    • minor

      public final byte minor
    • revision

      public final byte revision
    • build

      public final byte build
    • luceneVersion

      public final org.apache.lucene.util.Version luceneVersion
  • Method Details

    • readVersion

      public static Version readVersion(StreamInput in) throws IOException
    • fromId

      public static Version fromId(int id)
    • writeVersion

      public static void writeVersion(Version version, StreamOutput out) throws IOException
    • min

      public static Version min(Version version1, Version version2)
      Returns the minimum version between the 2.
    • max

      public static Version max(Version version1, Version version2)
      Returns the maximum version between the 2
    • fromString

      public static Version fromString(String version)
      Returns the version given its string representation, current version if the argument is null or empty
    • after

      public boolean after(Version version)
    • onOrAfter

      public boolean onOrAfter(Version version)
    • before

      public boolean before(Version version)
    • onOrBefore

      public boolean onOrBefore(Version version)
    • compareTo

      public int compareTo(Version other)
      Specified by:
      compareTo in interface Comparable<Version>
    • toXContent

      public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface ToXContent
    • minimumCompatibilityVersion

      public Version minimumCompatibilityVersion()
      Returns the minimum compatible version based on the current version. Ie a node needs to have at least the return version in order to communicate with a node running the current version. The returned version is in most of the cases the smallest major version release unless the current version is a beta or RC release then the version itself is returned.
    • minimumIndexCompatibilityVersion

      public Version minimumIndexCompatibilityVersion()
      Returns the minimum created index version that this version supports. Indices created with lower versions can't be used with this version. This should also be used for file based serialization backwards compatibility ie. on serialization code that is used to read / write file formats like transaction logs, cluster state, and index metadata.
    • isCompatible

      public boolean isCompatible(Version version)
      Returns true iff both version are compatible. Otherwise false
    • previousMajor

      public Version previousMajor()
      Returns a first major version previous to the version stored in this object. I.e 8.1.0 will return 7.0.0
    • main

      public static void main(String[] args)
    • toString

      public String toString()
      toString in class Object
    • equals

      public boolean equals(Object o)
      equals in class Object
    • hashCode

      public int hashCode()
      hashCode in class Object
    • isBeta

      public boolean isBeta()
    • isAlpha

      public boolean isAlpha()
      Returns true iff this version is an alpha version Note: This has been introduced in elasticsearch version 5. Previous versions will never have an alpha version.
    • isRC

      public boolean isRC()
    • isRelease

      public boolean isRelease()
    • getDeclaredVersions

      public static List<Version> getDeclaredVersions(Class<?> versionClass)
      Extracts a sorted list of declared version constants from a class. The argument would normally be Version.class but is exposed for testing with other classes-containing-version-constants.