Skip to content

Commit b56a922

Browse files
committed
fix(javadoc): add comprehensive Javadoc and suppress Lombok warnings
- Added complete Javadoc to FilterQuery getters and builder methods - Added complete Javadoc to HybridQuery getters - Added Javadoc to Route.RouteBuilder.references() method - Added @SuppressWarnings("javadoc") to Lombok classes (Route, RouteMatch, RoutingConfig, SemanticRouterBuilder) - Configured aggregateJavadoc task to suppress missing constructor warnings (-Xdoclint:-missing)
1 parent b4340fc commit b56a922

File tree

4 files changed

+134
-3
lines changed

4 files changed

+134
-3
lines changed

build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ tasks.register<Javadoc>("aggregateJavadoc") {
170170
"https://docs.oracle.com/en/java/javase/17/docs/api/",
171171
"https://www.javadoc.io/doc/redis.clients/jedis/latest/"
172172
)
173+
// Suppress warnings for Lombok-generated constructors
174+
addStringOption("Xdoclint:-missing", "-quiet")
173175
}
174176

175177
// Ensure Javadoc generation succeeds

core/src/main/java/com/redis/vl/extensions/router/Route.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
import lombok.Data;
1313

1414
/**
15-
* Model representing a routing path with associated metadata and thresholds. Ported from Python:
16-
* redisvl/extensions/router/schema.py:12
15+
* Model representing a routing path with associated metadata and thresholds.
16+
*
17+
* <p>Ported from Python: redisvl/extensions/router/schema.py:12
1718
*/
1819
@Data
1920
@Builder
@@ -23,14 +24,22 @@
2324
value = {"EI_EXPOSE_REP", "EI_EXPOSE_REP2"},
2425
justification =
2526
"Route is a data class with intentionally mutable fields for Python API compatibility")
27+
@SuppressWarnings("javadoc") // Lombok generates constructors
2628
public class Route {
2729
private String name;
2830
private List<String> references;
2931
@Builder.Default private Map<String, Object> metadata = Map.of();
3032
@Builder.Default private double distanceThreshold = 0.5;
3133

3234
/** Custom builder to ensure references list is mutable. */
35+
@SuppressWarnings("javadoc") // Lombok generates constructors
3336
public static class RouteBuilder {
37+
/**
38+
* Set the references list with a mutable copy.
39+
*
40+
* @param references List of reference strings
41+
* @return this builder
42+
*/
3443
public RouteBuilder references(List<String> references) {
3544
// Convert to ArrayList to ensure mutability for addRouteReferences/deleteRouteReferences
3645
this.references = references != null ? new ArrayList<>(references) : new ArrayList<>();

core/src/main/java/com/redis/vl/query/FilterQuery.java

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ private FilterQuery(FilterQueryBuilder builder) {
4545
this.params = builder.params != null ? Map.copyOf(builder.params) : Map.of();
4646
}
4747

48-
/** Create a new builder. */
48+
/**
49+
* Create a new builder.
50+
*
51+
* @return A new FilterQueryBuilder instance
52+
*/
4953
public static FilterQueryBuilder builder() {
5054
return new FilterQueryBuilder();
5155
}
@@ -119,30 +123,66 @@ public Query buildRedisQuery() {
119123
}
120124

121125
// Getters
126+
127+
/**
128+
* Get the filter expression.
129+
*
130+
* @return The filter expression
131+
*/
122132
public Filter getFilterExpression() {
123133
return filterExpression;
124134
}
125135

136+
/**
137+
* Get the fields to return in results.
138+
*
139+
* @return List of field names to return
140+
*/
126141
public List<String> getReturnFields() {
127142
return returnFields;
128143
}
129144

145+
/**
146+
* Get the number of results to return.
147+
*
148+
* @return Number of results
149+
*/
130150
public int getNumResults() {
131151
return numResults;
132152
}
133153

154+
/**
155+
* Get the query dialect.
156+
*
157+
* @return RediSearch dialect version
158+
*/
134159
public int getDialect() {
135160
return dialect;
136161
}
137162

163+
/**
164+
* Get the field to sort by.
165+
*
166+
* @return Sort field name, or null if not sorting
167+
*/
138168
public String getSortBy() {
139169
return sortBy;
140170
}
141171

172+
/**
173+
* Check if in-order matching is required.
174+
*
175+
* @return true if terms must appear in same order as query
176+
*/
142177
public boolean isInOrder() {
143178
return inOrder;
144179
}
145180

181+
/**
182+
* Get additional query parameters.
183+
*
184+
* @return Map of parameter name to value
185+
*/
146186
public Map<String, Object> getParams() {
147187
return params;
148188
}
@@ -159,6 +199,12 @@ public static class FilterQueryBuilder {
159199

160200
FilterQueryBuilder() {}
161201

202+
/**
203+
* Set the filter expression.
204+
*
205+
* @param filterExpression The filter to apply
206+
* @return this builder
207+
*/
162208
public FilterQueryBuilder filterExpression(Filter filterExpression) {
163209
this.filterExpression = filterExpression;
164210
return this;
@@ -175,21 +221,45 @@ public FilterQueryBuilder returnFields(List<String> returnFields) {
175221
return this;
176222
}
177223

224+
/**
225+
* Set the number of results to return.
226+
*
227+
* @param numResults Maximum number of results
228+
* @return this builder
229+
*/
178230
public FilterQueryBuilder numResults(int numResults) {
179231
this.numResults = numResults;
180232
return this;
181233
}
182234

235+
/**
236+
* Set the query dialect.
237+
*
238+
* @param dialect RediSearch dialect version
239+
* @return this builder
240+
*/
183241
public FilterQueryBuilder dialect(int dialect) {
184242
this.dialect = dialect;
185243
return this;
186244
}
187245

246+
/**
247+
* Set the field to sort results by.
248+
*
249+
* @param sortBy Field name to sort by
250+
* @return this builder
251+
*/
188252
public FilterQueryBuilder sortBy(String sortBy) {
189253
this.sortBy = sortBy;
190254
return this;
191255
}
192256

257+
/**
258+
* Set whether to require in-order term matching.
259+
*
260+
* @param inOrder true to require terms in same order as query
261+
* @return this builder
262+
*/
193263
public FilterQueryBuilder inOrder(boolean inOrder) {
194264
this.inOrder = inOrder;
195265
return this;
@@ -206,6 +276,11 @@ public FilterQueryBuilder params(Map<String, Object> params) {
206276
return this;
207277
}
208278

279+
/**
280+
* Build the FilterQuery instance.
281+
*
282+
* @return A new FilterQuery with the configured parameters
283+
*/
209284
public FilterQuery build() {
210285
return new FilterQuery(this);
211286
}

core/src/main/java/com/redis/vl/query/HybridQuery.java

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,20 @@ public static HybridQueryBuilder builder() {
185185

186186
// Getters with defensive copies for mutable fields
187187

188+
/**
189+
* Get the text query string.
190+
*
191+
* @return The text to search for
192+
*/
188193
public String getText() {
189194
return text;
190195
}
191196

197+
/**
198+
* Get the text field name.
199+
*
200+
* @return The field name containing text data
201+
*/
192202
public String getTextFieldName() {
193203
return textFieldName;
194204
}
@@ -202,26 +212,56 @@ public float[] getVector() {
202212
return vector != null ? vector.clone() : null;
203213
}
204214

215+
/**
216+
* Get the vector field name.
217+
*
218+
* @return The field name containing vector data
219+
*/
205220
public String getVectorFieldName() {
206221
return vectorFieldName;
207222
}
208223

224+
/**
225+
* Get the text scoring algorithm.
226+
*
227+
* @return The text scorer (e.g., "BM25", "TFIDF")
228+
*/
209229
public String getTextScorer() {
210230
return textScorer;
211231
}
212232

233+
/**
234+
* Get the filter expression.
235+
*
236+
* @return The filter to apply, or null if no filter
237+
*/
213238
public Filter getFilterExpression() {
214239
return filterExpression;
215240
}
216241

242+
/**
243+
* Get the alpha weighting factor.
244+
*
245+
* @return Weight between 0.0 (vector only) and 1.0 (text only)
246+
*/
217247
public float getAlpha() {
218248
return alpha;
219249
}
220250

251+
/**
252+
* Get the data type for vector storage.
253+
*
254+
* @return The data type (e.g., "float32", "float64")
255+
*/
221256
public String getDtype() {
222257
return dtype;
223258
}
224259

260+
/**
261+
* Get the maximum number of results.
262+
*
263+
* @return The result limit
264+
*/
225265
public int getNumResults() {
226266
return numResults;
227267
}
@@ -244,6 +284,11 @@ public Set<String> getStopwords() {
244284
return Collections.unmodifiableSet(stopwords);
245285
}
246286

287+
/**
288+
* Get the query dialect version.
289+
*
290+
* @return The dialect version (default 2)
291+
*/
247292
public int getDialect() {
248293
return dialect;
249294
}

0 commit comments

Comments
 (0)