<commit_before>package org.ppodgorsek.cache.invalidation.strategy.impl;

import java.util.List;

import org.ppodgorsek.cache.invalidation.exception.InvalidationException;
import org.ppodgorsek.cache.invalidation.helper.InvalidationHelper;
import org.ppodgorsek.cache.invalidation.model.InvalidationEntry;
import org.ppodgorsek.cache.invalidation.strategy.InvalidationStrategy;
import org.springframework.beans.factory.annotation.Required;

/**
 * Abstract strategy that invalidates entries by sending them to delegate helpers.
 * 
 * @author <NAME>
 */
public abstract class AbstractInvalidationStrategy<T extends InvalidationEntry> implements InvalidationStrategy<T> {

	private List<InvalidationHelper> helpers;

	/**
	 * Default constructor.
	 */
	public AbstractInvalidationStrategy() {
		super();
	}

	@Override
	public void delegateInvalidation(final T entry) throws InvalidationException {

		for (InvalidationHelper helper : helpers) {
			helper.invalidateEntry(entry);
		}
	}

	public List<InvalidationHelper> getHelpers() {
		return helpers;
	}

	@Required
	public void setHelpers(final List<InvalidationHelper> newHelpers) {
		helpers = newHelpers;
	}

}<commit_msg>Invalidation helpers are now configured according to a type of entry.<commit_after>package org.ppodgorsek.cache.invalidation.strategy.impl;

import java.util.List;

import org.ppodgorsek.cache.invalidation.exception.InvalidationException;
import org.ppodgorsek.cache.invalidation.helper.InvalidationHelper;
import org.ppodgorsek.cache.invalidation.model.InvalidationEntry;
import org.ppodgorsek.cache.invalidation.strategy.InvalidationStrategy;
import org.springframework.beans.factory.annotation.Required;

/**
 * Abstract strategy that invalidates entries by sending them to delegate helpers.
 * 
 * @author <NAME>
 */
public abstract class AbstractInvalidationStrategy<T extends InvalidationEntry> implements InvalidationStrategy<T> {

	private List<InvalidationHelper<T>> helpers;

	/**
	 * Default constructor.
	 */
	public AbstractInvalidationStrategy() {
		super();
	}

	@Override
	public void delegateInvalidation(final T entry) throws InvalidationException {

		for (InvalidationHelper<T> helper : helpers) {
			helper.invalidateEntry(entry);
		}
	}

	public List<InvalidationHelper<T>> getHelpers() {
		return helpers;
	}

	@Required
	public void setHelpers(final List<InvalidationHelper<T>> newHelpers) {
		helpers = newHelpers;
	}

}
{'fraction_non_alphanumeric': 0.09207266721717589, 'fraction_numerical': 0.0, 'mean_word_length': 5.768156424581005, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4447708', 'n_tokens_mistral': 712, 'n_tokens_neox': 688, 'n_words': 148}