com.factual.driver.QueryBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of factual-java-driver Show documentation
Show all versions of factual-java-driver Show documentation
Factual's officially supported Java driver
The newest version!
package com.factual.driver;
import java.util.List;
/**
* Provides fluent interface to specifying row filter predicate logic.
*
* @author brandon
*/
public class QueryBuilder {
protected final T query;
protected final String fieldName;
/**
* Constructor. Specifies the name of the field for which to build filter
* logic. Instance methods are used to specify the desired logic.
*/
public QueryBuilder(T query, String fieldName) {
this.query = query;
this.fieldName = fieldName;
}
/**
* Specifies a full text search.
*
* @param arg
* the term(s) for which to full text search against.
* @return the represented query, with the specified full text search added
* in.
*/
public T search(Object arg) {
return addFilter("$search", arg);
}
/**
* @deprecated use {@link #isEqual(Object)}
*/
@Deprecated
public T equal(Object arg) {
return addFilter("$eq", arg);
}
public T isEqual(Object arg) {
return addFilter("$eq", arg);
}
public T notEqual(Object arg) {
return addFilter("$neq", arg);
}
public T includesAnyList(List