<commit_before>package com.google.code.morphia;

import com.google.code.morphia.query.FilterOperator;
import com.google.code.morphia.query.Sort;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.regex.Pattern;

/**
 *
 * @author <NAME>
 */
public class Constraints implements Serializable {
   	private static final long serialVersionUID = 1L;

    private final Map<String,Object> query;
    private final Map<String,Integer> fields;

    private Sort sort;
    private int startIndex, resultSize;

    private String currentKey;

    public Constraints() {
        startIndex = -1;
        resultSize = -1;
        query = new HashMap<String,Object>();
        fields = new HashMap<String,Integer>();
    }
    
    public Constraints( String name, Object value ) {
        this();
        field(name).equalTo(value);
    }

    public Constraints orderByDesc( String name ) {
        return orderBy(name, false);
    }

    public Constraints orderBy( String name ) {
        return orderBy(name, true);
    }

    public Constraints orderBy( String name, boolean ascending ) {
        if ( sort == null ) {
            sort = new Sort();
        }
        sort.add(name, ascending);
        return this;
    }

    public Constraints skip( int resultsToSkip ) {
        startIndex = resultsToSkip;
        return this;
    }

    public Constraints limit( int batchSize ) {
        resultSize = batchSize;
        return this;
    }

    public Constraints field( String name ) {
        currentKey = name;
        return this;
    }

    public Constraints equalTo( Object value ) {
        return addField(value);<commit_msg>Added shorthand id() method for the _id field.<commit_after>package com.google.code.morphia;

import com.google.code.morphia.query.FilterOperator;
import com.google.code.morphia.query.Sort;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.regex.Pattern;

/**
 *
 * @author <NAME>
 */
public class Constraints implements Serializable {
   	private static final long serialVersionUID = 1L;

    private final Map<String,Object> query;
    private final Map<String,Integer> fields;

    private Sort sort;
    private int startIndex, resultSize;

    private String currentKey;

    public Constraints() {
        startIndex = -1;
        resultSize = -1;
        query = new HashMap<String,Object>();
        fields = new HashMap<String,Integer>();
    }
    
    public Constraints( String name, Object value ) {
        this();
        field(name).equalTo(value);
    }

    public Constraints orderByDesc( String name ) {
        return orderBy(name, false);
    }

    public Constraints orderBy( String name ) {
        return orderBy(name, true);
    }

    public Constraints orderBy( String name, boolean ascending ) {
        if ( sort == null ) {
            sort = new Sort();
        }
        sort.add(name, ascending);
        return this;
    }

    public Constraints skip( int resultsToSkip ) {
        startIndex = resultsToSkip;
        return this;
    }

    public Constraints limit( int batchSize ) {
        resultSize = batchSize;
        return this;
    }

    public Constraints field( String name ) {
        currentKey = name;
        return this;
    }

    public Constraints id() {
        currentKey = "_id";
        return this;
    }

    public Constraints equalTo( Object value ) {
        return addField(value);
{'fraction_non_alphanumeric': 0.09610604805302403, 'fraction_numerical': 0.0016570008285004142, 'mean_word_length': 2.5233463035019454, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '677102', 'n_tokens_mistral': 1033, 'n_tokens_neox': 1004, 'n_words': 289}