Author: chetanm
Date: Thu Dec  8 10:39:12 2016
New Revision: 1773210

URL: http://svn.apache.org/viewvc?rev=1773210&view=rev
Log:
OAK-5247 - Allow setting property node name in IndexDefinitionBuilder

-- Add method for setting type

Modified:
    
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/IndexDefinitionBuilder.java

Modified: 
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/IndexDefinitionBuilder.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/IndexDefinitionBuilder.java?rev=1773210&r1=1773209&r2=1773210&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/IndexDefinitionBuilder.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/IndexDefinitionBuilder.java
 Thu Dec  8 10:39:12 2016
@@ -278,6 +278,13 @@ public final class IndexDefinitionBuilde
             return this;
         }
 
+        public PropertyRule type(String type){
+            //This would throw an IAE if type is invalid
+            PropertyType.valueFromName(type);
+            propTree.setProperty(LuceneIndexConstants.PROP_TYPE, type);
+            return this;
+        }
+
         public PropertyRule useInSuggest(){
             propTree.setProperty(LuceneIndexConstants.PROP_USE_IN_SUGGEST, 
true);
             return this;
@@ -299,10 +306,8 @@ public final class IndexDefinitionBuilde
         }
 
         public PropertyRule ordered(String type){
-            //This would throw an IAE if type is invalid
-            PropertyType.valueFromName(type);
+            type(type);
             propTree.setProperty(LuceneIndexConstants.PROP_ORDERED, true);
-            propTree.setProperty(LuceneIndexConstants.PROP_TYPE, type);
             return this;
         }
 


Reply via email to