Skip to content

Commit 9b15f15

Browse files
committed
Add isEmpty method to AggregationResult
1 parent e7d40fe commit 9b15f15

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/redis/clients/jedis/search/aggr/AggregationResult.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ public List<String> getWarnings() {
6565
return warnings;
6666
}
6767

68+
/**
69+
* Tests if this aggregation result is empty.
70+
* @return true if there are no warnings and no rows, false otherwise
71+
*/
72+
public boolean isEmpty() {
73+
return (warnings == null || warnings.isEmpty()) && (results == null || results.isEmpty());
74+
}
75+
6876
public static final Builder<AggregationResult> SEARCH_AGGREGATION_RESULT = new Builder<AggregationResult>() {
6977

7078
private static final String TOTAL_RESULTS_STR = "total_results";

0 commit comments

Comments
 (0)