class AlterQueryServiceCommand extends SingleGfshCommand {

  @Override
  public boolean updateConfigForGroup(String group, CacheConfig config, Object configObject) {
    if (configObject instanceof QueryConfigService) {
      List<CacheElement> elements = config.getCustomCacheElements();
      elements.removeIf(e -> e instanceof QueryConfigService);
      elements.add((QueryConfigService) configObject);

      return true;
    }

    return false;
  }

}