@Override public Boolean execute(QueryParamsMap... operand) { QueryParamsMap queryParam = operand[0]; if (!queryParam.hasValue()) return false; String[] tagsToFilterOn = queryParam.values(); for (String eachTagToFilterOn : tagsToFilterOn) { if (eachTagToFilterOn != null && eachTagToFilterOn.trim().length() > 0) { return true; } } return false; } }
String[] tagFilters = tagFiltersQueryMap.values(); setUpTagFilters(photonRequest, tagFilters);
/** * Return the list of values mapped from a parameter associated with the * request being processed. This method is only appropriate for query * params and will not work for route variables (because those cannot * contain multiple values). * <p> * <strong>NOTE:</strong> If there are no values for {@code param}, then an * empty list is returned. * </p> * * @param param * @return the (possibly empty) list of values */ public final List<String> getParamValues(String param) { try { List<String> list = Lists.newArrayList(queryMap(param).values()); list.removeAll(EMPTY_STRING_COLLECTION); if(list.size() == 1) { String elt = list.get(0); elt.replaceAll(", ", ","); String[] elts = elt.split(","); list = Lists.newArrayList(elts); } return list; } catch (NullPointerException e) { // the param is not in the map, so // return an empty array return Lists.newArrayListWithCapacity(0); } }
String[] keys = req.queryMap("key").values(); if (keys.length == 0) { result.put("ok", false); String[] names = req.queryMap("name").values(); if (names.length == 0) { result.put("ok", false); String[] names = req.queryMap("name").values(); Map<String, Object> result = new HashMap<String, Object>(); Map<String, Long> versions = this.discovery.multiVersions(names);