Top Description Methods
org.osgi.resource

public Interface Resource

Known Direct Subinterfaces
org.osgi.framework.wiring.BundleRevision
Annotations
@ConsumerType
Imports
java.util.List, org.osgi.annotation.versioning.ConsumerType

A resource is the representation of a uniquely identified and typed data. A resource declares requirements that need to be satisfied by capabilities before it can provide its capabilities.

Instances of this type must be effectively immutable. That is, for a given instance of this interface, the methods defined by this interface must always return the same result.

Author
$Id: c7b6462fb53b38ac3071d7ba73af9dad2af6b9ce $

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if this Resource is equal to the other object; false otherwise.
equals
(Object
The object to compare against this Resource.
obj
)

Compares this Resource to another Resource.

public List<Capability>

Returns:

An unmodifiable list containing the declared Capabilitys from the specified namespace. The returned list will be empty if this resource declares no capabilities in the specified namespace.
getCapabilities
(String
The namespace of the declared capabilities to return or null to return the declared capabilities from all namespaces.
namespace
)

Returns the capabilities declared by this resource.

public List<Requirement>

Returns:

An unmodifiable list containing the declared Requirement s from the specified namespace. The returned list will be empty if this resource declares no requirements in the specified namespace.
getRequirements
(String
The namespace of the declared requirements to return or null to return the declared requirements from all namespaces.
namespace
)

Returns the requirements declared by this bundle resource.

public int

Returns:

The hashCode of this Resource.
hashCode
()

Returns the hashCode of this Resource.

Method Detail

equalsback to summary
public boolean equals(Object obj)

Compares this Resource to another Resource.

This Resource is equal to another Resource if both have the same content and come from the same location. Location may be defined as the bundle location if the resource is an installed bundle or the repository location if the resource is in a repository.

Parameters
obj:Object

The object to compare against this Resource.

Returns:boolean

true if this Resource is equal to the other object; false otherwise.

getCapabilitiesback to summary
public List<Capability> getCapabilities(String namespace)

Returns the capabilities declared by this resource.

Parameters
namespace:String

The namespace of the declared capabilities to return or null to return the declared capabilities from all namespaces.

Returns:List<Capability>

An unmodifiable list containing the declared Capabilitys from the specified namespace. The returned list will be empty if this resource declares no capabilities in the specified namespace.

getRequirementsback to summary
public List<Requirement> getRequirements(String namespace)

Returns the requirements declared by this bundle resource.

Parameters
namespace:String

The namespace of the declared requirements to return or null to return the declared requirements from all namespaces.

Returns:List<Requirement>

An unmodifiable list containing the declared Requirement s from the specified namespace. The returned list will be empty if this resource declares no requirements in the specified namespace.

hashCodeback to summary
public int hashCode()

Returns the hashCode of this Resource.

Returns:int

The hashCode of this Resource.