Package com.datastax.astra.client.model
Class FilterBuilder
java.lang.Object
com.datastax.astra.client.model.FilterBuilder
Helper to build a where clause in natural language (fluent API).
- Author:
- Cedrick LUNVEN (@clunven)
-
Constructor Summary
ModifierConstructorDescriptionprotected
FilterBuilder
(Filter filter, String fieldName) Only constructor allowed -
Method Summary
Modifier and TypeMethodDescriptionexists()
Add condition exists.hasSize
(int size) Condition to evaluate sizehasSubFieldsEqualsTo
(Map<String, Object> value) $eq: [ ...final <V> Filter
isAnArrayContaining
(V... value) $eq: [ ...isAnArrayExactlyEqualsTo
(Object[] value) $all: [ ...isEqualsTo
(Object value) "fieldName": "value" ($eq is omitted)isGreaterOrEqualsThan
(Object value) Add condition is greater than.isGreaterThan
(Object value) Add condition is less than.<V> Filter
isInArray
(V[] value) $in: [ ...isLessOrEqualsThan
(Object value) Add condition is less than.isLessThan
(Object value) Add condition is less than.isNotEqualsTo
(Object value) Add condition is not equals to.<V> Filter
isNotInArray
(V[] value) $in: [ ...
-
Constructor Details
-
FilterBuilder
Only constructor allowed- Parameters:
filter
- sample filterfieldName
- field name
-
-
Method Details
-
isEqualsTo
"fieldName": "value" ($eq is omitted)- Parameters:
value
- value- Returns:
- self reference
-
isAnArrayContaining
$eq: [ ... ]- Type Parameters:
V
- the type of the values- Parameters:
value
- value- Returns:
- self reference
-
isInArray
$in: [ ... ]- Type Parameters:
V
- the type of the values- Parameters:
value
- value- Returns:
- self reference
-
isNotInArray
$in: [ ... ]- Type Parameters:
V
- the type of the values- Parameters:
value
- value- Returns:
- self reference
-
isAnArrayExactlyEqualsTo
$all: [ ... ]- Parameters:
value
- value- Returns:
- self reference
-
hasSubFieldsEqualsTo
$eq: [ ... ]- Parameters:
value
- value- Returns:
- self reference
-
isLessThan
Add condition is less than.- Parameters:
value
- value- Returns:
- self reference
-
isLessOrEqualsThan
Add condition is less than.- Parameters:
value
- value- Returns:
- self reference
-
isGreaterThan
Add condition is less than.- Parameters:
value
- value- Returns:
- self reference
-
isGreaterOrEqualsThan
Add condition is greater than.- Parameters:
value
- value- Returns:
- self reference
-
isNotEqualsTo
Add condition is not equals to.- Parameters:
value
- value- Returns:
- self reference
-
exists
Add condition exists.- Returns:
- self reference
-
hasSize
Condition to evaluate size- Parameters:
size
- current size value- Returns:
- self reference
-