public void validateRetrieveSavings(final UriInfo uriInfo) { List<String> unsupportedParams = new ArrayList<>(); validateTemplate(uriInfo, unsupportedParams); Set<String> associationParameters = ApiParameterHelper.extractAssociationsForResponseIfProvided(uriInfo.getQueryParameters()); if (!associationParameters.isEmpty()) { associationParameters.removeAll(allowedAssociationParameters); if (!associationParameters.isEmpty()) { unsupportedParams.addAll(associationParameters); } } if (uriInfo.getQueryParameters().getFirst("exclude") != null) { unsupportedParams.add("exclude"); } throwExceptionIfReqd(unsupportedParams); }
private void validateTemplate(final UriInfo uriInfo, List<String> unsupportedParams) { final boolean templateRequest = ApiParameterHelper.template(uriInfo.getQueryParameters()); if (templateRequest) { unsupportedParams.add("template"); } }