<commit_before>package org.minimalj.transaction.predicate;

import java.util.function.Predicate;

public class By {

	public static <T> Predicate<T> search(String query) {
		return new SearchPredicate<T>(query);
	}
	
	public static <T> Predicate<T> search(String query, Object[] keys) {
		return new SearchPredicate<T>(query, keys);
	}

	public static <T> Predicate<T> field(Object key, Object value) {
		return new FieldPredicate<>(key, value);
	}

	public static <T> Predicate<T> field(Object key, FieldOperator operator, Object value) {
		return new FieldPredicate<>(key, operator, value);
	}

	public static <T> Predicate<T> all() {
		// the null predicate accepts by convention every object
		return null;
	}

}
<commit_msg>By: some more syntactical sugar<commit_after>package org.minimalj.transaction.predicate;

import java.util.function.Predicate;

public class By {

	public static <T> Predicate<T> search(String query) {
		return new SearchPredicate<T>(query);
	}
	
	public static <T> Predicate<T> search(String query, Object[] keys) {
		return new SearchPredicate<T>(query, keys);
	}

	public static <T> Predicate<T> field(Object key, Object value) {
		return new FieldPredicate<>(key, value);
	}

	public static <T> Predicate<T> field(Object key, FieldOperator operator, Object value) {
		return new FieldPredicate<>(key, operator, value);
	}

	public static <T> Predicate<T> all() {
		// the null predicate accepts by convention every object
		return null;
	}

	public static interface PersistenceFilter<T> {
		public Predicate<T> predicate();
	}
	
	public static <T> Predicate<T> filter(PersistenceFilter<T> filter) {
		return filter.predicate();
	}
}

{'fraction_non_alphanumeric': 0.11764705882352941, 'fraction_numerical': 0.0, 'mean_word_length': 4.974910394265233, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 36, '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': '5933110', 'n_tokens_mistral': 550, 'n_tokens_neox': 519, 'n_words': 159}