<commit_before>package com.oakcity.nicknack.events.filters;

import com.oakcity.nicknack.events.AttributeFilter;
import com.oakcity.nicknack.events.AttributeFilterSettings;
import com.oakcity.nicknack.events.Event.Attribute;
import com.oakcity.nicknack.events.attributes.OnOffPositionAttributeDefinition;
import com.oakcity.nicknack.events.attributes.units.BooleanUnit;

public class OnOffPositionAttributeFilter implements AttributeFilter<OnOffPositionAttributeDefinition, BooleanUnit, Boolean> {

	@Override
	public boolean match(Attribute<BooleanUnit, Boolean> attribute, AttributeFilterSettings<Boolean> settings) {
		if (settings.getFilterValues() == null) {
			return false;
		}
		
		if (!attribute.getAttributeDefinition().getName().equals(settings.getAttributeName())) {
			return false;
		}
		
		for (Boolean matchValue : settings.getFilterValues()) {
			if (matchValue.equals(attribute.getValue())) {
				return true;
			}
		}
		return false;
	}

	
	@Override
	public String getDescription() {
		return "Matches if the switch is in the specified position.";
	}

	@Override
	public Class<OnOffPositionAttributeDefinition> appliesTo() {
		return OnOffPositionAttributeDefinition.class;
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public AttributeFilterSettings<Boolean> newFilterSettings() {
		return new AttributeFilterSettingsImpl<OnOffPositionAttributeDefinition, BooleanUnit, Boolean>((Class<AttributeFilter<?, ?, Boolean>>) this.getClass());
	}

}<commit_msg>Fixed wacky Generics compilation error in Javac (but not Eclipse JDT).<commit_after>package com.oakcity.nicknack.events.filters;

import com.oakcity.nicknack.events.AttributeFilter;
import com.oakcity.nicknack.events.AttributeFilterSettings;
import com.oakcity.nicknack.events.Event.Attribute;
import com.oakcity.nicknack.events.attributes.OnOffPositionAttributeDefinition;
import com.oakcity.nicknack.events.attributes.units.BooleanUnit;


public class OnOffPositionAttributeFilter implements AttributeFilter<OnOffPositionAttributeDefinition, BooleanUnit, Boolean> {

	@Override
	public boolean match(Attribute<BooleanUnit, Boolean> attribute, AttributeFilterSettings<Boolean> settings) {
		if (settings.getFilterValues() == null) {
			return false;
		}
		
		if (!attribute.getAttributeDefinition().getName().equals(settings.getAttributeName())) {
			return false;
		}
		
		for (Boolean matchValue : settings.getFilterValues()) {
			if (matchValue.equals(attribute.getValue())) {
				return true;
			}
		}
		return false;
	}

	
	@Override
	public String getDescription() {
		return "Matches if the switch is in the specified position.";
	}

	@Override
	public Class<OnOffPositionAttributeDefinition> appliesTo() {
		return OnOffPositionAttributeDefinition.class;
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public AttributeFilterSettings<Boolean> newFilterSettings() {
		final Class<? extends AttributeFilter<?, ?, Boolean>> theClass = this.getClass();
		return new AttributeFilterSettingsImpl<OnOffPositionAttributeDefinition, BooleanUnit, Boolean>((Class<AttributeFilter<?, ?, Boolean>>) theClass);
	}

}
{'fraction_non_alphanumeric': 0.10294593719650372, 'fraction_numerical': 0.0, 'mean_word_length': 6.219626168224299, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '2408676', 'n_tokens_mistral': 914, 'n_tokens_neox': 853, 'n_words': 173}