class AlterQueryServiceCommand extends SingleGfshCommand {

  void populateMethodAuthorizer(String methodAuthorizerName, Set<String> parameterSet,
      QueryConfigService queryConfigService) {
    QueryConfigService.MethodAuthorizer methodAuthorizer =
        new QueryConfigService.MethodAuthorizer();
    methodAuthorizer.setClassName(methodAuthorizerName);

    if (!parameterSet.isEmpty()) {
      List<QueryConfigService.MethodAuthorizer.Parameter> parameterList = new ArrayList<>();

      for (String value : parameterSet) {
        QueryConfigService.MethodAuthorizer.Parameter parameter =
            new QueryConfigService.MethodAuthorizer.Parameter();
        parameter.setParameterValue(value);
        parameterList.add(parameter);
      }

      methodAuthorizer.setParameters(parameterList);
    }

    queryConfigService.setMethodAuthorizer(methodAuthorizer);
  }

}