Class QuerySelector
java.lang.Object
org.evomaster.client.java.controller.mongo.selectors.QuerySelector
- Direct Known Subclasses:
AllSelector,BitsAllClearSelector,BitsAllSetSelector,BitsAnyClearSelector,BitsAnySetSelector,ElemMatchSelector,EqualsSelector,ExistsSelector,GreaterThanEqualsSelector,GreaterThanSelector,ImplicitSelector,InSelector,LessThanEqualsSelector,LessThanSelector,ModSelector,MultiConditionQuerySelector,NearSphereSelector,NotEqualsSelector,NotInSelector,NotSelector,RegexSelector,SizeSelector,TypeSelector
A selector is used to determine if a query correspond to a certain operation.
To do so it checks that the syntax is correct (operator, value type, etc.).
Each selector maps to a unique operation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract StringextractOperator(Object query) Extracts the operator (for example $eq) from the query.abstract QueryOperationgetOperation(Object query) Returns the operation mapped to the selector if the query satisfy all syntax checks or null if not.protected BooleanhasTheExpectedOperator(Object query) Determines if the given query has the expected operator associated with the selector.protected BooleanisUniqueEntry(Map<?, ?> map) Determines if the given map contains exactly one entry.protected abstract Stringoperator()The operator a query must have to be considered as an instance of the corresponding operation.
-
Constructor Details
-
QuerySelector
public QuerySelector()
-
-
Method Details
-
getOperation
Returns the operation mapped to the selector if the query satisfy all syntax checks or null if not. -
isUniqueEntry
Determines if the given map contains exactly one entry.- Parameters:
map- the map to be checked for uniqueness of entries; must not be null- Returns:
- true if the map contains exactly one entry; false otherwise
-
hasTheExpectedOperator
Determines if the given query has the expected operator associated with the selector.- Parameters:
query- the query object whose operator needs to be checked; must not be null- Returns:
- true if the query contains the expected operator; false otherwise
-
extractOperator
Extracts the operator (for example $eq) from the query. -
operator
The operator a query must have to be considered as an instance of the corresponding operation.
-