public static Restriction contains(Element element, String value1, String... otherValues) { List<String> values = new LinkedList<String>(); values.add(value1); for (String val : otherValues) { values.add(val); } return contains(element, values); }
/** * Contains. * * Search on lists (multivalued fields) that a field contains all the values * of the list given in parameter. * * Ex : The field with value [toto,titi,tutu] contains [titi,tutu] but not * [titi,tutu,tata] * * Ps : Use wildcards if you search for substrings. * * @param element the element on which the restriction is put * @param values the values to search in the element * @return {@code this} with the {@code contains} restriction added. */ public Search contains(String element, Collection<String> values) { restrictions.add(RestrictionHelper.contains(elt(element), new ArrayList<String>(values))); return this; }
/** * Contains. * * Search on lists (multivalued fields) that a field contains all the values * given in parameter. * * Ex : The field with value [toto,titi,tutu] contains [titi,tutu] but not * [titi,tutu,tata] * * Ps : Use wildcards if you search for substrings. * * @param element the element on which the restriction is put * @param value1 first value to search in the field * @param values list of values to search in the field * @return {@code this} with the {@code contains} restriction added. */ public Search contains(String element, String value1, String ... values) { restrictions.add(RestrictionHelper.contains(elt(element), value1, values)); return this; }