Skip to main content
summaryrefslogtreecommitdiffstats
blob: fa6b3b48555ab85ca8434a3d91d743c2b43b2831 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/******************************************************************************* 
* Copyright (c) 2008, 2009 EclipseSource and others. All rights reserved. This
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
*   EclipseSource - initial API and implementation
 *   IBM - ongoing development
******************************************************************************/
package org.eclipse.equinox.p2.metadata;

import org.eclipse.equinox.internal.provisional.p2.metadata.Version;

/**
 * Describes a capability as exposed or required by an installable unit
 * 
 * @noimplement This interface is not intended to be implemented by clients.
 * @noextend This interface is not intended to be extended by clients.
 * @since 2.0
 */
public interface IProvidedCapability {

	public String getName();

	public String getNamespace();

	public Version getVersion();

	/**
	 * Returns whether this provided capability satisfies the given required capability.
	 * @return <code>true</code> if this capability satisfies the given required
	 * capability, and <code>false</code> otherwise.
	 * 
	 * This method must maintain the following semantics:
	 * <ul>
	 *  <li> If the provided capability and the candidate have different names, 
	 *       return false
	 *  <li> If the provided capability and the candidate have different namespaces.
	 *       return false
	 *  <li> If the candidate's version range includes the provided capability's
	 *       version, return true
	 *  <li> otherwise, return false    
	 * </ul>
	 * 
	 */
	public boolean satisfies(IRequirement candidate);

	/**
	 * Returns whether this provided capability is equal to the given object.
	 * 
	 * This method returns <i>true</i> if:
	 * <ul>
	 *  <li> Both this object and the given object are of type IProvidedCapability
	 *  <li> The result of <b>getName()</b> on both objects are equal
	 *  <li> The result of <b>getNamespace()</b> on both objects are equal
	 *  <li> The result of <b>getVersion()</b> on both objects are equal
	 * </ul> 
	 */
	public boolean equals(Object other);

}

Back to the top