Get number of Subscriptions matching the query params

@param params {@link QueryParams}
@return Integer on success, null otherwise
774841
public Integer getSubscriptionsCount(final QueryParams params) {
        FluentCaseInsensitiveStringsMap map = doHEAD(Subscription.SUBSCRIPTION_RESOURCE,  params);
        return Integer.parseInt(map.getFirstValue(X_RECORDS_HEADER_NAME));
    }
22487
protected String getParameter(final List<String> params, final int index) {

		if (params.size() > index) {

			return params.get(index);
		}

		return null;
	}
257782
def get_matching_students_count(params={})
      api_path = "/ws/v1/district/student/count"

      query   = build_query(params)
      options = {query: { "q" => query } }  unless query.empty?
      return {"errorMessage"=>{"message"=>"A valid parameter must be entered."}} if query.empty?

      answer  = api(:get, api_path, options)  #returns: {"resource"=>{"count"=>423}}
      answer.dig("resource", "count").to_i
    end
1047389
public CmsGallerySearchResultList getResult(CmsGallerySearchParameters params) throws CmsException {

        CmsGallerySearchResultList result = null;
        if ((m_cms == null) || (m_index == null)) {
            throw new CmsException(Messages.get().container(Messages.ERR_SEARCH_NOT_INITIALIZED_0));
        }
        result = m_index.gallerySearch(m_cms, params);

        if (result.size() > 0) {

            result.calculatePages(params.getResultPage(), params.getMatchesPerPage());

        } else {
            result = new CmsGallerySearchResultList();
        }

        return result;
    }
341721
public int subscribe(final String subscriptionName, Object[] params) {
        // add the subscription to the HashMap with its initial value "false" which says that it is not ready
        subscriptionsAreReady.put(subscriptionName, false);
        
        // subscribe to a Meteor collection with given params
        // test error handling for invalid subscription
        return getDDP().subscribe(subscriptionName, params, new DDPListener() {
            @Override
            public void onReady(String id) {
                // mark subscription ready
                subscriptionsAreReady.replace(subscriptionName, true);

                // broadcast that subscription has been updated
                broadcastSubscriptionChanged(subscriptionName,
                        DdpMessageType.READY, null);
            }

            @Override
            public void onResult(Map<String, Object> jsonFields) {
                String msgtype = (String) jsonFields
                        .get(DdpMessageField.MSG);
                // ignore {"server_id":"GqrKrbcSeDfTYDkzQ"} web socket msgs
                if ((msgtype != null) && (msgtype.equals(DdpMessageType.ERROR))) {
                    broadcastDDPError((String) jsonFields
                            .get(DdpMessageField.ERRORMSG));
                }
            }
        });
    }
225156
protected boolean parametersAreAdequate(Map<String, String> oauthParams) {
    return oauthParams.containsKey(OAuthConsumerParameter.oauth_consumer_key.toString());
  }
1036207
public static Pager getPagerFromParams(MultivaluedMap<String, String> params) {
		Pager pager = new Pager();
		pager.setPage(NumberUtils.toLong(paramOrDefault(params, "page", ""), 0));
		if (pager.getPage() > Config.MAX_PAGES) {
			pager.setPage(Config.MAX_PAGES);
		}
		pager.setLimit(NumberUtils.toInt(paramOrDefault(params, "limit", ""), pager.getLimit()));
		if (pager.getLimit() > Config.MAX_PAGE_LIMIT) {
			pager.setLimit(Config.MAX_PAGE_LIMIT);
		}
		pager.setSortby(paramOrDefault(params, "sort", pager.getSortby()));
		pager.setDesc(Boolean.parseBoolean(paramOrDefault(params, "desc", "true")));
		pager.setLastKey(paramOrDefault(params, "lastKey", null));
		return pager;
	}
1269453
protected String buildParamsQuery(final Map<String, String> params)
			throws UnsupportedEncodingException {
		StringBuilder builder = new StringBuilder();
		if (params.isEmpty()) {
			return builder.toString();
		}

		String sep = "";
		for (Map.Entry<String, String> entry : params.entrySet()) {
			builder.append(sep);
			builder.append(urlencode(entry.getKey()));
			builder.append("=");
			builder.append(urlencode(entry.getValue()));
			sep = "&";
		}

		return builder.toString();
	}
1016691
public java.util.List<Subscription> getSubscriptions() {
        if (subscriptions == null) {
            subscriptions = new com.amazonaws.internal.SdkInternalList<Subscription>();
        }
        return subscriptions;
    }
760062
protected void getPage(final JSONObject params) {
		
		if (this.client == null)
			client = BandwidthClient.getInstance();
    	
        try {
	        final RestResponse response = client.get(resourceUri, params);
	        
	        final JSONArray array = Utils.response2JSONArray(response);
	        
	        for (final Object obj : array) {	
        		final E elem = clazz.getConstructor(BandwidthClient.class, JSONObject.class).newInstance(client, (JSONObject) obj);
        		add(elem);
	        }
	        
	        // if anything comes back, reset the index
	        if (array.size() > 0)
	        	this.index = 0;
	        
	        // set the next links
	        this.setNextLink(response.getNextLink());	        
	        this.setFirstLink(response.getFirstLink());
	        this.setPreviousLink(response.getPreviousLink());
        }
        catch(final Exception e) {
        	e.printStackTrace();
        }
	}
836349
int getNumberOfNullEnderParameter(List<String> parameters) {
		int nbnull = 0;
		for (int i = parameters.size() - 1; i >= 0; i--) {
			String parameter = parameters.get(i);
			if (parameter.equals("null")) {
				nbnull++;
			} else {
				break;
			}
		}
		return nbnull;
	}
655966
public function count($params) {
        $orm = !is_null($params['ormObject']) ? $params['ormObject'] : ORM::for_table($params['table']);

        return $orm->count();
    }
907885
public URIBuilder queryParameters( Map<String, String> queryParams )
    {
        this.queryParams.clear();
        this.queryParams.putAll( queryParams );
        return this;
    }
258304
def get_query_params(self):
        """"""
        params = self.request.query_params.copy()
        params.update(self.request.data)
        return params
1137005
private static String queryString( final Map<String, List<String>> params ) {
        final StringBuilder builder = new StringBuilder();
        if (params != null && params.size() > 0) {
            for (final Iterator<String> it = params.keySet().iterator(); it.hasNext(); ) {
                final String key = it.next();
                final List<String> values = params.get(key);
                for (final String value : values) {
                    try {
                        builder.append(key + "=" + URLEncoder.encode(value, "UTF-8") + "&");
                    } catch (final UnsupportedEncodingException e) {
                        builder.append(key + "=" + value + "&");
                    }
                }
            }
            return builder.length() > 0 ? "?" + builder.substring(0, builder.length() - 1) : "";
        }
        return "";
    }
1234372
function(params) {

  if (!params) {
    return {
      error: 'params cannot be null.'
    };
  }

  // query is mandatory
  if (!params.hasOwnProperty('query')) {
    return {
      error: 'query param required.'
    };
  }

  if (!validator.isString(params.query)) {
    return {
      error: 'query must be a string.'
    };
  }

  if (!validator.isValidType(params)) {
    return {
      error: 'type must be: movie, series, episode.'
    };
  }

  if (params.hasOwnProperty('year') && !validator.isNumber(params.year)) {
    return { 
      error: 'year must be a valid number'
    };
  }

}
1214118
private CmsSearchParameters getSearchParameters(Map<String, String> params) {

        CmsSearchParameters searchParams = new CmsSearchParameters();
        searchParams.setQuery(params.get(PARAM_QUERY));
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(params.get(PARAM_SORT))) {
            searchParams.setSortName(params.get(PARAM_SORT));
        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(params.get(PARAM_MINCREATIONDATE))) {
            searchParams.setMinDateCreated(Long.parseLong(params.get(PARAM_MINCREATIONDATE)));
        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(params.get(PARAM_MAXCREATIONDATE))) {
            searchParams.setMaxDateCreated(Long.parseLong(params.get(PARAM_MAXCREATIONDATE)));
        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(params.get(PARAM_MINLASTMODIFICATIONDATE))) {
            searchParams.setMinDateLastModified(Long.parseLong(params.get(PARAM_MINLASTMODIFICATIONDATE)));
        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(params.get(PARAM_MAXLASTMODIFICATIONDATE))) {
            searchParams.setMaxDateLastModified(Long.parseLong(params.get(PARAM_MAXLASTMODIFICATIONDATE)));
        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(params.get(PARAM_INDEXNAME))) {
            searchParams.setIndex(params.get(PARAM_INDEXNAME));
        }

        List<String> fields = CmsStringUtil.splitAsList(params.get(PARAM_FIELDS), ',');
        searchParams.setFields(fields);
        searchParams.setSearchPage(Integer.parseInt(params.get(I_CmsListResourceCollector.PARAM_PAGE)));
        return searchParams;
    }