LuceneIndexProperty.java
3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.google.common.base.Preconditions
* com.google.common.base.Strings
* javax.annotation.Nonnull
* javax.jcr.PropertyType
*/
package com.adobe.granite.repository.impl.lucene.util;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import javax.annotation.Nonnull;
import javax.jcr.PropertyType;
public class LuceneIndexProperty {
public static final int TYPE_UNDEFINED = Integer.MIN_VALUE;
private boolean propertyIndex;
private boolean ordered;
private boolean analyzed;
private boolean useInSuggest;
private String nodeName;
private String property;
private String type;
private boolean useInSpellcheck;
private boolean nullCheckEnabled;
private boolean nodeScopeIndex;
public LuceneIndexProperty(@Nonnull String nodeName, boolean propertyIndex, @Nonnull String property, int type) {
this(nodeName, propertyIndex, property, type, false);
}
public LuceneIndexProperty(@Nonnull String nodeName, boolean propertyIndex, @Nonnull String property, int type, boolean ordered) {
this(nodeName, propertyIndex, property, type, ordered, false);
}
public LuceneIndexProperty(@Nonnull String nodeName, boolean propertyIndex, @Nonnull String property, int type, boolean ordered, boolean analyzed) {
Preconditions.checkArgument((boolean)(!Strings.isNullOrEmpty((String)nodeName)));
Preconditions.checkArgument((boolean)(!Strings.isNullOrEmpty((String)property)));
this.nodeName = nodeName;
this.propertyIndex = propertyIndex;
this.property = property;
this.type = type == Integer.MIN_VALUE ? null : PropertyType.nameFromValue((int)type);
this.ordered = ordered;
this.analyzed = analyzed;
}
public LuceneIndexProperty(@Nonnull String nodeName, boolean propertyIndex, @Nonnull String property, int type, boolean ordered, boolean analyzed, boolean useInSuggest) {
this(nodeName, propertyIndex, property, type, ordered, analyzed);
this.useInSuggest = useInSuggest;
}
public LuceneIndexProperty(@Nonnull String nodeName, boolean propertyIndex, @Nonnull String property, int type, boolean ordered, boolean analyzed, boolean useInSuggest, boolean useInSpellcheck) {
this(nodeName, propertyIndex, property, type, ordered, analyzed, useInSuggest);
this.useInSpellcheck = useInSpellcheck;
}
public boolean isPropertyIndex() {
return this.propertyIndex;
}
public String getProperty() {
return this.property;
}
public String getType() {
return this.type;
}
public String getNodeName() {
return this.nodeName;
}
public boolean isOrdered() {
return this.ordered;
}
public boolean isAnalyzed() {
return this.analyzed;
}
public boolean isUseInSuggest() {
return this.useInSuggest;
}
public LuceneIndexProperty withUseInSuggest(boolean useInSuggest) {
this.useInSuggest = useInSuggest;
return this;
}
public boolean isUseInSpellcheck() {
return this.useInSpellcheck;
}
public boolean isNullCheckEnabled() {
return this.nullCheckEnabled;
}
public LuceneIndexProperty withNullCheckEnabled(boolean nullCheckEnabled) {
this.nullCheckEnabled = nullCheckEnabled;
return this;
}
public boolean isNodeScopeIndex() {
return this.nodeScopeIndex;
}
public LuceneIndexProperty withNodeScopeIndex(boolean nodeScopeIndex) {
this.nodeScopeIndex = nodeScopeIndex;
return this;
}
}