Ejemplo n.º 1
0
 /** @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;
 }
Ejemplo n.º 2
0
 /**
  * @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;
 }
Ejemplo n.º 3
0
 /**
  * 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;
 }
Ejemplo n.º 4
0
 /**
  * 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());
 }
Ejemplo n.º 5
0
 /**
  * @param sorts the sorts to set
  * @return this builder itself
  */
 public SearchOptionsBuilder setSort(final List<Sort> sorts) {
   options.setSorts(sorts);
   return this;
 }
Ejemplo n.º 6
0
 /**
  * @param filters the filters to set
  * @return this builder itself
  */
 public SearchOptionsBuilder setFilters(final List<SearchFilter> filters) {
   options.setFilters(filters);
   return this;
 }
Ejemplo n.º 7
0
 /**
  * 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;
 }
Ejemplo n.º 8
0
 /**
  * @param value the search term
  * @return this builder itself
  */
 public SearchOptionsBuilder searchTerm(final String value) {
   options.setSearchTerm(value);
   return this;
 }
Ejemplo n.º 9
0
 public SearchOptionsBuilder rightParenthesis() {
   options.addRightParenthesis();
   return this;
 }
Ejemplo n.º 10
0
 public SearchOptionsBuilder leftParenthesis() {
   options.addLeftParenthesis();
   return this;
 }
Ejemplo n.º 11
0
 /**
  * @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;
 }
Ejemplo n.º 12
0
 /**
  * @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;
 }