org.apache.lucene.util

## Class Version

- java.lang.Object
- - org.apache.lucene.util.Version

-     public final class Version
      extends Object

  Use by certain classes to match version compatibility across releases of Lucene.

  WARNING: When changing the version parameter that you supply to components in Lucene, do not simply change the version at search-time, but instead also adjust your indexing code to match, and re-index.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `bugfix` Bugfix number, incremented on release branches
    `static Version` | `LATEST` WARNING: if you use this setting, and then upgrade to a newer release of Lucene, sizable changes may happen.
    `static Version` | `LUCENE_4_0` Deprecated. Bad naming of constant; use `LUCENE_4_0_0` instead (this constant actually points to `LUCENE_4_0_0_ALPHA` to match whole 4.0 series).
    `static Version` | `LUCENE_4_0_0` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_0_0_ALPHA` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_0_0_BETA` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_1` Deprecated. Bad naming of constant; use `LUCENE_4_1_0` instead.
    `static Version` | `LUCENE_4_1_0` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_10_0` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_10_1` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_10_2` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_10_3` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_10_4` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_2` Deprecated. Bad naming of constant; use `LUCENE_4_2_0` instead.
    `static Version` | `LUCENE_4_2_0` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_2_1` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_3` Deprecated. Bad naming of constant; use `LUCENE_4_3_0` instead.
    `static Version` | `LUCENE_4_3_0` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_3_1` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_4` Deprecated. Bad naming of constant; use `LUCENE_4_4_0` instead.
    `static Version` | `LUCENE_4_4_0` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_5` Deprecated. Bad naming of constant; use `LUCENE_4_5_0` instead.
    `static Version` | `LUCENE_4_5_0` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_5_1` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_6` Deprecated. Bad naming of constant; use `LUCENE_4_6_0` instead.
    `static Version` | `LUCENE_4_6_0` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_6_1` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_7` Deprecated. Bad naming of constant; use `LUCENE_4_7_0` instead.
    `static Version` | `LUCENE_4_7_0` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_7_1` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_7_2` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_8` Deprecated. Bad naming of constant; use `LUCENE_4_8_0` instead.
    `static Version` | `LUCENE_4_8_0` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_8_1` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_9` Deprecated. Bad naming of constant; use `LUCENE_4_9_0` instead.
    `static Version` | `LUCENE_4_9_0` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_4_9_1` Deprecated. (5.0) Use latest
    `static Version` | `LUCENE_5_0_0` Deprecated. (5.1.0) Use latest
    `static Version` | `LUCENE_5_1_0` Deprecated. (5.2.0) Use latest
    `static Version` | `LUCENE_5_2_0` Deprecated. (5.3.0) Use latest
    `static Version` | `LUCENE_5_2_1` Deprecated. Use latest
    `static Version` | `LUCENE_5_3_0` Deprecated. (5.4.0) Use latest
    `static Version` | `LUCENE_5_3_1` Deprecated. Use latest
    `static Version` | `LUCENE_5_3_2` Deprecated. Use latest
    `static Version` | `LUCENE_5_4_0` Deprecated. (5.5.0) Use latest
    `static Version` | `LUCENE_5_4_1` Deprecated. Use latest
    `static Version` | `LUCENE_5_5_0` Deprecated. (5.5.1) Use latest
    `static Version` | `LUCENE_5_5_1` Deprecated. (5.5.2) Use latest
    `static Version` | `LUCENE_5_5_2` Deprecated. (5.5.3) Use latest
    `static Version` | `LUCENE_5_5_3` Deprecated. (5.5.4) Use latest
    `static Version` | `LUCENE_5_5_4` Deprecated. (5.5.5) Use latest
    `static Version` | `LUCENE_5_5_5` Match settings and bugs in Lucene's 5.5.5 release.
    `static Version` | `LUCENE_CURRENT` Deprecated. Use `LATEST`
    `int` | `major` Major version, the difference between stable and trunk
    `int` | `minor` Minor version, incremented within the stable branch
    `int` | `prerelease` Prerelease version, currently 0 (alpha), 1 (beta), or 2 (final)

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `static Version` | `fromBits(int major, int minor, int bugfix)` Returns a new version based on raw numbers
    `int` | `hashCode()`
    `boolean` | `onOrAfter(Version other)` Returns true if this version is the same or after the version from the argument.
    `static Version` | `parse(String version)` Parse a version number of the form `"major.minor.bugfix.prerelease"`.
    `static Version` | `parseLeniently(String version)` Parse the given version number as a constant or dot based version.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### LUCENE_4_0_0_ALPHA

          @Deprecated
          public static final Version LUCENE_4_0_0_ALPHA

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.0.0-ALPHA release.

    - #### LUCENE_4_0_0_BETA

          @Deprecated
          public static final Version LUCENE_4_0_0_BETA

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.0.0-BETA release.

    - #### LUCENE_4_0_0

          @Deprecated
          public static final Version LUCENE_4_0_0

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.0.0 release.

    - #### LUCENE_4_1_0

          @Deprecated
          public static final Version LUCENE_4_1_0

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.1.0 release.

    - #### LUCENE_4_2_0

          @Deprecated
          public static final Version LUCENE_4_2_0

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.2.0 release.

    - #### LUCENE_4_2_1

          @Deprecated
          public static final Version LUCENE_4_2_1

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.2.1 release.

    - #### LUCENE_4_3_0

          @Deprecated
          public static final Version LUCENE_4_3_0

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.3.0 release.

    - #### LUCENE_4_3_1

          @Deprecated
          public static final Version LUCENE_4_3_1

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.3.1 release.

    - #### LUCENE_4_4_0

          @Deprecated
          public static final Version LUCENE_4_4_0

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.4.0 release.

    - #### LUCENE_4_5_0

          @Deprecated
          public static final Version LUCENE_4_5_0

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.5.0 release.

    - #### LUCENE_4_5_1

          @Deprecated
          public static final Version LUCENE_4_5_1

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.5.1 release.

    - #### LUCENE_4_6_0

          @Deprecated
          public static final Version LUCENE_4_6_0

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.6.0 release.

    - #### LUCENE_4_6_1

          @Deprecated
          public static final Version LUCENE_4_6_1

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.6.1 release.

    - #### LUCENE_4_7_0

          @Deprecated
          public static final Version LUCENE_4_7_0

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.7.0 release.

    - #### LUCENE_4_7_1

          @Deprecated
          public static final Version LUCENE_4_7_1

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.7.1 release.

    - #### LUCENE_4_7_2

          @Deprecated
          public static final Version LUCENE_4_7_2

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.7.2 release.

    - #### LUCENE_4_8_0

          @Deprecated
          public static final Version LUCENE_4_8_0

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.8.0 release.

    - #### LUCENE_4_8_1

          @Deprecated
          public static final Version LUCENE_4_8_1

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.8.1 release.

    - #### LUCENE_4_9_0

          @Deprecated
          public static final Version LUCENE_4_9_0

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.9.0 release.

    - #### LUCENE_4_9_1

          @Deprecated
          public static final Version LUCENE_4_9_1

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.9.1 release.

    - #### LUCENE_4_10_0

          @Deprecated
          public static final Version LUCENE_4_10_0

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.10.0 release.

    - #### LUCENE_4_10_1

          @Deprecated
          public static final Version LUCENE_4_10_1

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.10.1 release.

    - #### LUCENE_4_10_2

          @Deprecated
          public static final Version LUCENE_4_10_2

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.10.2 release.

    - #### LUCENE_4_10_3

          @Deprecated
          public static final Version LUCENE_4_10_3

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.10.3 release.

    - #### LUCENE_4_10_4

          @Deprecated
          public static final Version LUCENE_4_10_4

      Deprecated. (5.0) Use latest
      Match settings and bugs in Lucene's 4.10.4 release.

    - #### LUCENE_5_0_0

          @Deprecated
          public static final Version LUCENE_5_0_0

      Deprecated. (5.1.0) Use latest
      Match settings and bugs in Lucene's 5.0 release.

      Use this to get the latest & greatest settings, bug fixes, etc, for Lucene.

    - #### LUCENE_5_1_0

          @Deprecated
          public static final Version LUCENE_5_1_0

      Deprecated. (5.2.0) Use latest
      Match settings and bugs in Lucene's 5.1.0 release.

    - #### LUCENE_5_2_0

          @Deprecated
          public static final Version LUCENE_5_2_0

      Deprecated. (5.3.0) Use latest
      Match settings and bugs in Lucene's 5.2.0 release.

    - #### LUCENE_5_2_1

          @Deprecated
          public static final Version LUCENE_5_2_1

      Deprecated. Use latest
      Match settings and bugs in Lucene's 5.2.1 release.

    - #### LUCENE_5_3_0

          @Deprecated
          public static final Version LUCENE_5_3_0

      Deprecated. (5.4.0) Use latest
      Match settings and bugs in Lucene's 5.3.0 release.

    - #### LUCENE_5_3_1

          @Deprecated
          public static final Version LUCENE_5_3_1

      Deprecated. Use latest
      Match settings and bugs in Lucene's 5.3.1 release.

    - #### LUCENE_5_3_2

          @Deprecated
          public static final Version LUCENE_5_3_2

      Deprecated. Use latest
      Match settings and bugs in Lucene's 5.3.2 release.

    - #### LUCENE_5_4_0

          @Deprecated
          public static final Version LUCENE_5_4_0

      Deprecated. (5.5.0) Use latest
      Match settings and bugs in Lucene's 5.4.0 release.

    - #### LUCENE_5_4_1

          @Deprecated
          public static final Version LUCENE_5_4_1

      Deprecated. Use latest
      Match settings and bugs in Lucene's 5.4.1 release.

    - #### LUCENE_5_5_0

          @Deprecated
          public static final Version LUCENE_5_5_0

      Deprecated. (5.5.1) Use latest
      Match settings and bugs in Lucene's 5.5.0 release.

    - #### LUCENE_5_5_1

          @Deprecated
          public static final Version LUCENE_5_5_1

      Deprecated. (5.5.2) Use latest
      Match settings and bugs in Lucene's 5.5.1 release.

    - #### LUCENE_5_5_2

          @Deprecated
          public static final Version LUCENE_5_5_2

      Deprecated. (5.5.3) Use latest
      Match settings and bugs in Lucene's 5.5.2 release.

    - #### LUCENE_5_5_3

          @Deprecated
          public static final Version LUCENE_5_5_3

      Deprecated. (5.5.4) Use latest
      Match settings and bugs in Lucene's 5.5.3 release.

    - #### LUCENE_5_5_4

          @Deprecated
          public static final Version LUCENE_5_5_4

      Deprecated. (5.5.5) Use latest
      Match settings and bugs in Lucene's 5.5.4 release.

    - #### LUCENE_5_5_5

          public static final Version LUCENE_5_5_5

      Match settings and bugs in Lucene's 5.5.5 release.

      Use this to get the latest & greatest settings, bug fixes, etc, for Lucene.

    - #### LATEST

          public static final Version LATEST

      WARNING: if you use this setting, and then upgrade to a newer release of Lucene, sizable changes may happen. If backwards compatibility is important then you should instead explicitly specify an actual version.

      If you use this constant then you may need to re-index all of your documents when upgrading Lucene, as the way text is indexed may have changed. Additionally, you may need to re-test your entire application to ensure it behaves as expected, as some defaults may have changed and may break functionality in your application.

    - #### LUCENE_CURRENT

          @Deprecated
          public static final Version LUCENE_CURRENT

      Deprecated. Use `LATEST`
      Constant for backwards compatibility.

    - #### LUCENE_4_0

          @Deprecated
          public static final Version LUCENE_4_0

      Deprecated. Bad naming of constant; use `LUCENE_4_0_0` instead (this constant actually points to `LUCENE_4_0_0_ALPHA` to match whole 4.0 series).

    - #### LUCENE_4_1

          @Deprecated
          public static final Version LUCENE_4_1

      Deprecated. Bad naming of constant; use `LUCENE_4_1_0` instead.

    - #### LUCENE_4_2

          @Deprecated
          public static final Version LUCENE_4_2

      Deprecated. Bad naming of constant; use `LUCENE_4_2_0` instead.

    - #### LUCENE_4_3

          @Deprecated
          public static final Version LUCENE_4_3

      Deprecated. Bad naming of constant; use `LUCENE_4_3_0` instead.

    - #### LUCENE_4_4

          @Deprecated
          public static final Version LUCENE_4_4

      Deprecated. Bad naming of constant; use `LUCENE_4_4_0` instead.

    - #### LUCENE_4_5

          @Deprecated
          public static final Version LUCENE_4_5

      Deprecated. Bad naming of constant; use `LUCENE_4_5_0` instead.

    - #### LUCENE_4_6

          @Deprecated
          public static final Version LUCENE_4_6

      Deprecated. Bad naming of constant; use `LUCENE_4_6_0` instead.

    - #### LUCENE_4_7

          @Deprecated
          public static final Version LUCENE_4_7

      Deprecated. Bad naming of constant; use `LUCENE_4_7_0` instead.

    - #### LUCENE_4_8

          @Deprecated
          public static final Version LUCENE_4_8

      Deprecated. Bad naming of constant; use `LUCENE_4_8_0` instead.

    - #### LUCENE_4_9

          @Deprecated
          public static final Version LUCENE_4_9

      Deprecated. Bad naming of constant; use `LUCENE_4_9_0` instead.

    - #### major

          public final int major

      Major version, the difference between stable and trunk

    - #### minor

          public final int minor

      Minor version, incremented within the stable branch

    - #### bugfix

          public final int bugfix

      Bugfix number, incremented on release branches

    - #### prerelease

          public final int prerelease

      Prerelease version, currently 0 (alpha), 1 (beta), or 2 (final)

  - ### Method Detail

    - #### parse

          public static Version parse(String version)
                               throws ParseException

      Parse a version number of the form `"major.minor.bugfix.prerelease"`. Part `".bugfix"` and part `".prerelease"` are optional. Note that this is forwards compatible: the parsed version does not have to exist as a constant.
      Throws:
        `ParseException`
      NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

    - #### parseLeniently

          public static Version parseLeniently(String version)
                                        throws ParseException

      Parse the given version number as a constant or dot based version.

      This method allows to use `"LUCENE_X_Y"` constant names, or version numbers in the format `"x.y.z"`.

      Throws:
        `ParseException`
      NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

    - #### fromBits

          public static Version fromBits(int major,
                         int minor,
                         int bugfix)

      Returns a new version based on raw numbers
      NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

    - #### onOrAfter

          public boolean onOrAfter(Version other)

      Returns true if this version is the same or after the version from the argument.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.