| 1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2009, 2017 EclipseSource and others. |
| 3 |
* |
| 4 |
* This |
| 5 |
* program and the accompanying materials are made available under the terms of |
| 6 |
* the Eclipse Public License 2.0 which accompanies this distribution, and is |
| 7 |
* available at |
| 8 |
* https://www.eclipse.org/legal/epl-2.0/ |
| 9 |
* |
| 10 |
* SPDX-License-Identifier: EPL-2.0 |
| 11 |
* |
| 12 |
* Contributors: |
| 13 |
* EclipseSource - initial API and implementation |
| 14 |
******************************************************************************/ |
| 15 |
package org.eclipse.equinox.p2.query; |
| 16 |
|
| 17 |
/** |
| 18 |
* A query in which the elements can be evaluated by calling isMatch on. Each |
| 19 |
* element can be evaluated independently of all other elements. Match queries |
| 20 |
* can be evaluated in parallel as each call {@link #isMatch(Object)} is |
| 21 |
* mutually |
| 22 |
* |
| 23 |
* @noimplement This interface is not intended to be implemented by clients. |
| 24 |
* Clients creating custom queries must extend |
| 25 |
* {@link ExpressionMatchQuery}. |
| 26 |
* @deprecated If possible, use one of the predefined queries in |
| 27 |
* {@link QueryUtil} or use the |
| 28 |
* {@link QueryUtil#createMatchQuery(String, Object...)} to create a |
| 29 |
* custom expression based query. If the query cannot be expressed |
| 30 |
* using the p2QL, then use a predefined or custom expression query |
| 31 |
* as a first filter (in worst case, use |
| 32 |
* {@link QueryUtil#createIUAnyQuery()}) and then provide further |
| 33 |
* filtering like so: |
| 34 |
* |
| 35 |
* <pre> |
| 36 |
* for (iter = queryable.query(someExpressionQuery).iterator(); iter.hasNext();) { |
| 37 |
* // do your match here |
| 38 |
* } |
| 39 |
* </pre> |
| 40 |
* |
| 41 |
* @since 2.0 |
| 42 |
*/ |
| 43 |
@Deprecated |
| 44 |
public interface IMatchQuery<T> extends IQuery<T> { |
| 45 |
|
| 46 |
/** |
| 47 |
* Returns whether the given object satisfies the parameters of this query. |
| 48 |
* |
| 49 |
* @param candidate The object to perform the query against |
| 50 |
* @return <code>true</code> if the unit satisfies the parameters of this query, |
| 51 |
* and <code>false</code> otherwise |
| 52 |
* |
| 53 |
* @noreference This method is not intended to be referenced by clients. |
| 54 |
* @since 2.0 |
| 55 |
*/ |
| 56 |
public boolean isMatch(T candidate); |
| 57 |
} |