Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactDescriptorQuery.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactDescriptorQuery.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactDescriptorQuery.java
index 56337f1be..26e096645 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactDescriptorQuery.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactDescriptorQuery.java
@@ -12,12 +12,12 @@
package org.eclipse.equinox.p2.repository.artifact;
-import org.eclipse.equinox.p2.query.ExpressionMatchQuery;
-
import java.util.*;
import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
+import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.VersionRange;
import org.eclipse.equinox.p2.metadata.expression.*;
+import org.eclipse.equinox.p2.query.ExpressionMatchQuery;
/**
* A general purpose query for matching {@link IArtifactDescriptor} instances
@@ -74,6 +74,15 @@ public class ArtifactDescriptorQuery extends ExpressionMatchQuery<IArtifactDescr
}
/**
+ * The query will match descriptors whose <code>id</code> and <code>versionRange</code>
+ * match the supplied key
+ * @param key the artifact key to match. Cannot be <code>null</code>.
+ */
+ public ArtifactDescriptorQuery(IArtifactKey key) {
+ super(IArtifactDescriptor.class, createExpression(key.getId(), new VersionRange(key.getVersion(), true, key.getVersion(), true), null, null));
+ }
+
+ /**
* The query will match descriptors with the given <code>id</code>, <code>versionRange</code>,
* <code>format</code>, and <code>properties</code>.
* @param id the descriptor id to match. Can not be <code>null</code>

Back to the top