Allows to check if any of the <i>get</i>XXX methods return non empty/non null results of {@link javax.money
.MonetaryAmountFactory}.

@param query the factory query, not null.
@return true, if at least one {@link MonetaryAmountFactory} matches the query.
168222
public static boolean isAvailable(MonetaryAmountFactoryQuery query) {
        return Optional.ofNullable(monetaryAmountsSingletonQuerySpi()).orElseThrow(() -> new MonetaryException(
                "No MonetaryAmountsSingletonQuerySpi loaded, query functionality is not available."))
                .isAvailable(query);
    }
996183
@Override
    public Collection<MonetaryAmountFormat> getAmountFormats(AmountFormatQuery amountFormatQuery) {
        requireNonNull(amountFormatQuery, "AmountFormatContext required");
        if (!amountFormatQuery.getProviderNames().isEmpty() &&
                !amountFormatQuery.getProviderNames().contains(getProviderName())) {
            return emptySet();
        }
        if (amountFormatQuery.getFormatName() != null && !DEFAULT_STYLE.equals(amountFormatQuery.getFormatName())) {
            return emptySet();
        }
        AmountFormatContextBuilder builder = AmountFormatContextBuilder.of(DEFAULT_STYLE);
        if (amountFormatQuery.getLocale() != null) {
            builder.setLocale(amountFormatQuery.getLocale());
        }
        builder.importContext(amountFormatQuery, false);
        builder.setMonetaryAmountFactory(amountFormatQuery.getMonetaryAmountFactory());
        AmountFormatContext amountFormatContext = builder.build();
        return asList(new MonetaryAmountFormat[]{new DefaultMonetaryAmountFormat(amountFormatContext)});
    }
555653
public BoxRequestsSearch.Search getSearchRequest(String query) {
        BoxRequestsSearch.Search request = new BoxRequestsSearch.Search(query, getSearchUrl(), mSession);
        return request;
    }
1192097
@SafeVarargs
    public final boolean exists(final String query, final Object... parameters) {
        final QueryResult resultSet = execute(query, parameters);

        return resultSet.iterator().hasNext();
    }
194484
public Results search(Query query) throws IOException {
    return search(clientKey, Collections.<String, String>emptyMap(), query);
  }
964676
public List findByQuery(String query, Map<Parameter, Object> parameterMap, int firstResult, int maxResult)
    {
        s = getStatelessSession();

        Query q = s.createQuery(query);
        q.setFirstResult(firstResult);
        q.setMaxResults(maxResult);

        setParameters(parameterMap, q);

        return q.list();
    }
37703
private void validateQuery(Query query) throws IllegalArgumentException {
    if (query.getKindCount() != 1) {
      throw new IllegalArgumentException("Query must have exactly one kind.");
    }
    if (query.getOrderCount() != 0) {
      throw new IllegalArgumentException("Query cannot have any sort orders.");
    }
    if (query.hasFilter()) {
      validateFilter(query.getFilter());
    }
  }
927530
private static function isValidUriQuery(?string $query): bool
    {
        if ($query === null || $query === '') {
            return true;
        }

        // http://tools.ietf.org/html/rfc3986#section-3.4
        // query = *( pchar / "/" / "?" )
        // pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
        $pattern = sprintf(
            '/\A(?:[%s%s\/?:@]|(?:%s))*\z/i',
            'a-z0-9\-._~',
            '!$&\'()*+,;=',
            '%[a-f0-9]{2}'
        );

        return !!preg_match($pattern, $query);
    }
564578
public boolean matches(Request req) {
        if (!method.equals(req.getMethod())) return false;
        if (useRegexForPath) {
            if (!req.getPath().getPath().matches(basePath)) return false;
        } else {
            if (!basePath.equals(req.getPath().getPath())) return false;
        }
        if (!queries.keySet().containsAll(req.getQuery().keySet())) return false;
        if (!req.getNames().containsAll(headers.keySet())) return false;

        try {
            if (!isEmpty(bodyMustContain) && !req.getContent().contains(bodyMustContain))
                return false;
        } catch (IOException e) {
            return false;
        }

        for (Map.Entry<String, String> reqQuery : req.getQuery().entrySet()) {
            String respRegex = queries.get(reqQuery.getKey());
            if (!reqQuery.getValue().matches(respRegex)) return false;
        }
        for(Map.Entry<String, String> header : headers.entrySet()) {
            String headerValueRegex = header.getValue();
            if(!req.getValue(header.getKey()).matches(headerValueRegex)) return false;
        }
        return true;
    }
547840
public static Collection<MonetaryAmountFactory<?>> getAmountFactories(MonetaryAmountFactoryQuery query) {
        return Optional.ofNullable(monetaryAmountsSingletonQuerySpi()).orElseThrow(() -> new MonetaryException(
                "No MonetaryAmountsSingletonQuerySpi loaded, query functionality is not available."))
                .getAmountFactories(query);
    }
304421
private boolean querySupported(Query<Entity> q) {
    return !containsAnyOperator(q, unsupportedOperators)
        && !containsComputedAttribute(q, getEntityType())
        && !containsNestedQueryRuleField(q);
  }
1086898
function validateQuery(query) {
		Assert.ok(((query) && ((typeof query) === 'object')),
			'The Query object was not set?');
		Assert.ok(((query.QueryString) && ((typeof query.QueryString) === 'string')),
			'The query string was not set?');
		Assert.ok(((query.ResultConfiguration) && ((typeof query.ResultConfiguration) === 'object')),
			'The result configuation in the query object was not set?');
		Assert.ok(((query.ResultConfiguration.OutputLocation) && ((typeof query.ResultConfiguration.OutputLocation) === 'string')),
			'The output location of the result configuration in the query object was not set?');
		return query;
}
941302
@SuppressWarnings("unchecked")
    @Override
    public final V getEntity(final NamedParameterQueryData query) {
        final Query builtQuery; // Query created from the query data
        V entity; // Entity acquired from the query

        checkNotNull(query, "Received a null pointer as the query");

        // Builds the query
        builtQuery = buildQuery(query);

        // Tries to acquire the entity
        try {
            entity = (V) builtQuery.getSingleResult();
        } catch (final NoResultException exception) {
            entity = null;
        }

        return entity;
    }
606360
public static Predicate<MonetaryAmount> isCurrency(
			CurrencyUnit... currencies) {

		if (Objects.isNull(currencies) || currencies.length == 0) {
			return m -> true;
		}
		Predicate<MonetaryAmount> predicate = null;

		for (CurrencyUnit currencyUnit : currencies) {
			if (Objects.isNull(predicate)) {
				predicate = m -> m.getCurrency().equals(currencyUnit);
			} else {
				predicate = predicate.or(m -> m.getCurrency().equals(
						currencyUnit));
			}
		}
		return predicate;
    }
203215
public SearchResult<WorkflowSummary> search(@Nonnull String query) {
        return search(null, null, null, null, query);
    }
1047149
public Collection<Class<? extends MonetaryAmount>> getAmountTypes(MonetaryAmountFactoryQuery query) {
        Collection<MonetaryAmountFactory<? extends MonetaryAmount>> factories = getAmountFactories(query);
        Set<Class<? extends MonetaryAmount>> result = new HashSet<>();
        for(MonetaryAmountFactory f:factories){
            //noinspection unchecked
            result.add(f.getAmountType());
        }
        return result;
    }
1281064
@Override
    public QueryResult search(Query query) throws TwitterException {
        if (query.nextPage() != null) {
            return factory.createQueryResult(get(conf.getRestBaseURL()
                    + "search/tweets.json" + query.nextPage()), query);
        } else {
            return factory.createQueryResult(get(conf.getRestBaseURL()
                    + "search/tweets.json", query.asHttpParameterArray()), query);
        }
    }