/** @return this builder itself */ public SearchOptionsBuilder and() { if (options.getFilters().size() == 0) { throw new IllegalArgumentException("AND operator cannot be the first filter in the list."); } options.addAndFilter(); return this; }
/** * @param field * @param value * @return this builder itself * @see SearchOptionsBuilder#filter(String, java.io.Serializable) for field values */ public SearchOptionsBuilder greaterOrEquals(final String field, final Serializable value) { options.addGreaterOrEqualsFilter(field, value); return this; }
/** * Filter the results to the specific value for the specific field (equality) * * @param field The name of the field to filter on. Depending on the search parameter, specify the * field by accessing the relevant xxxSearchDescriptor classes. For example, <code> * HumanTaskInstanceSearchDescriptor.NAME</code> and <code> * HumanTaskInstanceSearchDescriptor.PROCESS_DEFINITION_ID</code>. * @param value the single value to filter on that field name * @return this builder itself * @since 6.0 */ public SearchOptionsBuilder filter(final String field, final Serializable value) { options.addFilter(field, value); return this; }
/** * Creates a new <code>SearchOptionsBuilder</code> from another instance by * * @param searchOptions */ public SearchOptionsBuilder(final SearchOptions searchOptions) { options = new SearchOptionsImpl(searchOptions.getStartIndex(), searchOptions.getMaxResults()); options.setFilters(searchOptions.getFilters()); options.setSorts(searchOptions.getSorts()); options.setSearchTerm(searchOptions.getSearchTerm()); }
/** * @param sorts the sorts to set * @return this builder itself */ public SearchOptionsBuilder setSort(final List<Sort> sorts) { options.setSorts(sorts); return this; }
/** * @param filters the filters to set * @return this builder itself */ public SearchOptionsBuilder setFilters(final List<SearchFilter> filters) { options.setFilters(filters); return this; }
/** * Adds a sort order option to the list of sort options * * @param field the field name to sort by * @param order the order of the sort (ASCENDING, DESCENDING) * @return the current SearchOptionsBuilder */ public SearchOptionsBuilder sort(final String field, final Order order) { options.addSort(field, order); return this; }
/** * @param value the search term * @return this builder itself */ public SearchOptionsBuilder searchTerm(final String value) { options.setSearchTerm(value); return this; }
public SearchOptionsBuilder rightParenthesis() { options.addRightParenthesis(); return this; }
public SearchOptionsBuilder leftParenthesis() { options.addLeftParenthesis(); return this; }
/** * @param field * @param value * @return this builder itself * @see SearchOptionsBuilder#filter(String, java.io.Serializable) for field values */ public SearchOptionsBuilder differentFrom(final String field, final Serializable value) { options.addDifferentFromFilter(field, value); return this; }
/** * @param field the field that should be between * @param from from this value * @param to to this value * @return this builder itself * @see SearchOptionsBuilder#filter(String, java.io.Serializable) for field values */ public SearchOptionsBuilder between( final String field, final Serializable from, final Serializable to) { options.addBetweenFilter(field, from, to); return this; }