Package com.yahoo.search.predicate
Class PredicateQueryParser
java.lang.Object
com.yahoo.search.predicate.PredicateQueryParser
Parses predicate queries from JSON.
Input JSON is assumed to have the following format:
{
"features": [
{"k": "key-name", "v":"value", "s":"0xDEADBEEFDEADBEEF"}
],
"rangeFeatures": [
{"k": "key-name", "v":42, "s":"0xDEADBEEFDEADBEEF"}
]
}
- Author:
- bjorncs
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
parseJsonQuery
(String json, PredicateQueryParser.FeatureHandler<String> featureHandler, PredicateQueryParser.FeatureHandler<Long> rangeFeatureHandler) Parses predicate query from JSON.
-
Constructor Details
-
PredicateQueryParser
public PredicateQueryParser()
-
-
Method Details
-
parseJsonQuery
public void parseJsonQuery(String json, PredicateQueryParser.FeatureHandler<String> featureHandler, PredicateQueryParser.FeatureHandler<Long> rangeFeatureHandler) throws IllegalArgumentException Parses predicate query from JSON.- Parameters:
json
- JSON input.featureHandler
- The handler is invoked when a feature is parsed.rangeFeatureHandler
- The handler is invoked when a range feature is parsed.- Throws:
IllegalArgumentException
- If JSON is invalid.
-