Class InsightParamUtils
java.lang.Object
com.codebarrel.automation.api.insight.rule.InsightParamUtils
Utility methods to help parse query params and provide simple validation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<InsightFilter> parseFilter(String projectId, com.google.common.collect.Multimap<String, String> queryParams, ErrorCollection errors) Parses filter object from request paramsparseLimit(com.google.common.collect.Multimap<String, String> queryParams, ErrorCollection errors) Parses limit value from request paramsstatic Optional<InsightSort> parseSort(com.google.common.collect.Multimap<String, String> queryParams, ErrorCollection errors) Parses sort object from request params
-
Constructor Details
-
InsightParamUtils
public InsightParamUtils()
-
-
Method Details
-
parseFilter
public static Optional<InsightFilter> parseFilter(String projectId, com.google.common.collect.Multimap<String, String> queryParams, ErrorCollection errors) Parses filter object from request params- Parameters:
projectId- Project idqueryParams- Request query paramserrors- Modified collection to return errors- Returns:
- InsightFilter if successful, otherwise empty and ErrorCollection with errors
-
parseSort
public static Optional<InsightSort> parseSort(com.google.common.collect.Multimap<String, String> queryParams, ErrorCollection errors) Parses sort object from request params- Parameters:
queryParams- Request query paramserrors- Modified collection to return errors- Returns:
- InsightFilter if successful, otherwise empty and ErrorCollection with errors
-
parseLimit
public static Optional<Integer> parseLimit(com.google.common.collect.Multimap<String, String> queryParams, ErrorCollection errors) Parses limit value from request params- Parameters:
queryParams- Request query paramserrors- Modified collection to return errors- Returns:
- Limit if successful, otherwise empty and ErrorCollection with errors
-