class CategoriesService extends ConfigurationService<Categories> {

	public void addRuleByName(String name, MatchRule matchRule) {
		Categories categories = retrieve();
		Category category = findCategoryByName(categories, name);

		List<Category> values = new ArrayList<>(categories.getCategories());
		int indexOf = values.indexOf(category);
		values.set(indexOf, category.withMatchRule(matchRule));

		update(new Categories(values));
	}

	@Inject  CategoriesService(CategoriesPersistenceService persistenceService, EntityEventSupport eventSupport);

}