| 1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2008, 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 |
* IBM - ongoing development |
| 15 |
* Todor Boev |
| 16 |
******************************************************************************/ |
| 17 |
package org.eclipse.equinox.p2.metadata; |
| 18 |
|
| 19 |
import java.util.Map; |
| 20 |
import org.eclipse.equinox.p2.metadata.expression.IFilterExpression; |
| 21 |
|
| 22 |
/** |
| 23 |
* Describes a capability that is exposed by an installable unit. These capabilities |
| 24 |
* can satisfy the dependencies of other installable units, causing the unit |
| 25 |
* providing the dependency to be installed. |
| 26 |
* <p> |
| 27 |
* Instances of this class are handle objects and do not necessarily |
| 28 |
* reflect entities that exist in any particular profile or repository. These handle |
| 29 |
* objects can be created using {@link MetadataFactory}. |
| 30 |
* </p> |
| 31 |
* |
| 32 |
* @noimplement This interface is not intended to be implemented by clients. |
| 33 |
* @noextend This interface is not intended to be extended by clients. |
| 34 |
* @since 2.0 |
| 35 |
* @see IRequirement |
| 36 |
*/ |
| 37 |
public interface IProvidedCapability { |
| 38 |
/** |
| 39 |
* The name of the property under which the capability version is stored. |
| 40 |
* |
| 41 |
* Can be used with {@link #getProperties()}. The same value can be obtained with {@link #getVersion()} |
| 42 |
* |
| 43 |
* @since 2.4 |
| 44 |
*/ |
| 45 |
String PROPERTY_VERSION = "version"; //$NON-NLS-1$ |
| 46 |
|
| 47 |
/** |
| 48 |
* |
| 49 |
* @return String the namespace of this capability. |
| 50 |
* @noreference This method is not intended to be referenced by clients. |
| 51 |
*/ |
| 52 |
String getNamespace(); |
| 53 |
|
| 54 |
/** |
| 55 |
* |
| 56 |
* @return String the attribute stored under a key equal to the {@link #getNamespace()} attribute of this capability. |
| 57 |
* @noreference This method is not intended to be referenced by clients. |
| 58 |
*/ |
| 59 |
String getName(); |
| 60 |
|
| 61 |
/** |
| 62 |
* |
| 63 |
* @return String the special {@link #PROPERTY_VERSION} attribute of this capability. |
| 64 |
* @noreference This method is not intended to be referenced by clients. |
| 65 |
*/ |
| 66 |
Version getVersion(); |
| 67 |
|
| 68 |
/** |
| 69 |
* A full description of this capability including the name and the version. |
| 70 |
* <p> |
| 71 |
* Such a description can be used to match this capability with an {@link IFilterExpression LDAP filter} for example. |
| 72 |
* |
| 73 |
* @return An unmodifiable map |
| 74 |
* @noreference This method is not intended to be referenced by clients. |
| 75 |
* @since 2.4 |
| 76 |
*/ |
| 77 |
Map<String, Object> getProperties(); |
| 78 |
|
| 79 |
/** |
| 80 |
* Returns whether this provided capability is equal to the given object. |
| 81 |
* |
| 82 |
* This method returns <i>true</i> if: |
| 83 |
* <ul> |
| 84 |
* <li>Both this object and the given object are of type IProvidedCapability</li> |
| 85 |
* <li>The result of {@link #getNamespace()} on both objects are equal</li> |
| 86 |
* <li>The result of {@link #getProperties()} on both objects are equal</li> |
| 87 |
* </ul> |
| 88 |
*/ |
| 89 |
@Override |
| 90 |
boolean equals(Object other); |
| 91 |
} |