<commit_before>package org.smof.collection;

import org.bson.BsonDocument;
import org.smof.element.Element;
import org.smof.parsers.SmofParser;

import com.mongodb.client.FindIterable;
import com.mongodb.client.model.Filters;

@SuppressWarnings("javadoc")
public class SmofQuery<T extends Element> {

	private final Class<T> elementClass;
	private final FindIterable<BsonDocument> rawQuery;
	private final SmofParser parser;
	
	SmofQuery(Class<T> elementClass, FindIterable<BsonDocument> rawQuery, SmofParser parser) {
		this.elementClass = elementClass;
		this.rawQuery = rawQuery;
		this.parser = parser;
	}
	
	public Class<T> getElementClass() {
		return elementClass;
	}

	public SmofResults<T> results() {
		return new SmofResults<T>(rawQuery, parser, elementClass);
	}

	public void withField(String fieldName, String artistName) {
		rawQuery.filter(Filters.eq(fieldName, artistName));
		
	}
	
	
}<commit_msg>added TODO<commit_after>package org.smof.collection;

import org.bson.BsonDocument;
import org.smof.element.Element;
import org.smof.parsers.SmofParser;

import com.mongodb.client.FindIterable;
import com.mongodb.client.model.Filters;

@SuppressWarnings("javadoc")
public class SmofQuery<T extends Element> {

	private final Class<T> elementClass;
	private final FindIterable<BsonDocument> rawQuery;
	private final SmofParser parser;
	
	SmofQuery(Class<T> elementClass, FindIterable<BsonDocument> rawQuery, SmofParser parser) {
		this.elementClass = elementClass;
		this.rawQuery = rawQuery;
		this.parser = parser;
	}
	
	public Class<T> getElementClass() {
		return elementClass;
	}

	public SmofResults<T> results() {
		return new SmofResults<T>(rawQuery, parser, elementClass);
	}

	public SmofQuery<T> withField(String fieldName, Object filterValue) {
		//validateFieldValue(fieldName, filterValue);
		rawQuery.filter(Filters.eq(fieldName, filterValue));
		return this;
	}
	
}
{'fraction_non_alphanumeric': 0.10395778364116096, 'fraction_numerical': 0.0, 'mean_word_length': 5.747330960854092, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '511123', 'n_tokens_mistral': 646, 'n_tokens_neox': 613, 'n_words': 131}