All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.trepo.dcap.store.Query Maven / Gradle / Ivy

The newest version!
package com.github.trepo.dcap.store;

import java.util.ArrayList;
import java.util.List;

/**
 * @author John Clark.
 */
public class Query {

    /**
     * A list of expressions mean to be "anded" together.
     */
    private List expressions;

    /**
     * Create a new query.
     */
    public Query() {
        expressions = new ArrayList<>();
    }

    /**
     * Filter commits based on if the key matches the predicate.
     * @param key The Attribute to compare with.
     * @param predicate The predicate.
     * @param value The value to compare to.
     * @return This query (for chaining).
     */
    public Query has(Key key, Predicate predicate, Object value) {
        expressions.add(new Expression(key, predicate, value));
        return this;
    }

    /**
     * Gets the list of expressions.
     * @return The list of expressions.
     */
    public List getExpressions() {
        return expressions;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy