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

com.jparams.store.query.QueryImpl Maven / Gradle / Ivy

There is a newer version: 3.1.4
Show newest version
package com.jparams.store.query;

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

class QueryImpl implements BasicQuery, AndQuery, OrQuery
{
    private final List indexMatches = new ArrayList<>();
    private Operator operator;

    @Override
    public AndQuery and(final String indexName, final Object key)
    {
        indexMatches.add(new IndexMatch(indexName, key));
        operator = Operator.AND;
        return this;
    }

    @Override
    public OrQuery or(final String indexName, final Object key)
    {
        indexMatches.add(new IndexMatch(indexName, key));
        operator = Operator.OR;
        return this;
    }

    @Override
    public QueryDefinition build()
    {
        return new QueryDefinition(indexMatches, operator);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy