pylucene 3.5.0-3
[pylucene.git] / lucene-java-3.5.0 / lucene / src / java / org / apache / lucene / util / Version.java
1 package org.apache.lucene.util;
2
3 /**
4  * Licensed to the Apache Software Foundation (ASF) under one or more
5  * contributor license agreements.  See the NOTICE file distributed with
6  * this work for additional information regarding copyright ownership.
7  * The ASF licenses this file to You under the Apache License, Version 2.0
8  * (the "License"); you may not use this file except in compliance with
9  * the License.  You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20
21 /**
22  * Use by certain classes to match version compatibility
23  * across releases of Lucene.
24  * 
25  * <p><b>WARNING</b>: When changing the version parameter
26  * that you supply to components in Lucene, do not simply
27  * change the version at search-time, but instead also adjust
28  * your indexing code to match, and re-index.
29  */
30 // remove me when java 5 is no longer supported
31 // this is a workaround for a JDK bug that wrongly emits a warning.
32 @SuppressWarnings("dep-ann")
33 public enum Version {
34
35   /** Match settings and bugs in Lucene's 2.0 release. 
36    * @deprecated (3.1) Use latest 
37    */
38   @Deprecated
39   LUCENE_20,
40
41   /** Match settings and bugs in Lucene's 2.1 release. 
42    * @deprecated (3.1) Use latest 
43    */
44   @Deprecated
45   LUCENE_21,
46
47   /** Match settings and bugs in Lucene's 2.2 release. 
48    * @deprecated (3.1) Use latest 
49    */
50   @Deprecated
51   LUCENE_22,
52
53   /** Match settings and bugs in Lucene's 2.3 release. 
54    * @deprecated (3.1) Use latest 
55    */
56   @Deprecated
57   LUCENE_23,
58
59   /** Match settings and bugs in Lucene's 2.4 release. 
60    * @deprecated (3.1) Use latest 
61    */
62   @Deprecated
63   LUCENE_24,
64
65   /** Match settings and bugs in Lucene's 2.9 release. 
66    * @deprecated (3.1) Use latest 
67    */
68   @Deprecated
69   LUCENE_29,
70
71   /** Match settings and bugs in Lucene's 3.0 release. */
72   LUCENE_30,
73
74   /** Match settings and bugs in Lucene's 3.1 release. */
75   LUCENE_31,
76   
77   /** Match settings and bugs in Lucene's 3.2 release. */
78   LUCENE_32,
79   
80   /** Match settings and bugs in Lucene's 3.3 release. */
81   LUCENE_33,
82   
83   /** Match settings and bugs in Lucene's 3.4 release. */
84   LUCENE_34,
85   
86   /**
87    * Match settings and bugs in Lucene's 3.5 release.
88    * <p>
89    * Use this to get the latest &amp; greatest settings, bug
90    * fixes, etc, for Lucene.
91    */
92   LUCENE_35,
93   
94   /* Add new constants for later versions **here** to respect order! */
95
96   /**
97    * <p><b>WARNING</b>: if you use this setting, and then
98    * upgrade to a newer release of Lucene, sizable changes
99    * may happen.  If backwards compatibility is important
100    * then you should instead explicitly specify an actual
101    * version.
102    * <p>
103    * If you use this constant then you  may need to 
104    * <b>re-index all of your documents</b> when upgrading
105    * Lucene, as the way text is indexed may have changed. 
106    * Additionally, you may need to <b>re-test your entire
107    * application</b> to ensure it behaves as expected, as 
108    * some defaults may have changed and may break functionality 
109    * in your application. 
110    * @deprecated Use an actual version instead. 
111    */
112   @Deprecated
113   LUCENE_CURRENT;
114
115   public boolean onOrAfter(Version other) {
116     return compareTo(other) >= 0;
117   }
118 }