Package org.osgi.resource
Interface Resource
-
- All Known Subinterfaces:
BundleRevision
@ConsumerType public interface Resource
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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Compares thisResource
to anotherResource
.java.util.List<Capability>
getCapabilities(java.lang.String namespace)
Returns the capabilities declared by this resource.java.util.List<Requirement>
getRequirements(java.lang.String namespace)
Returns the requirements declared by this bundle resource.int
hashCode()
Returns the hashCode of thisResource
.
-
-
-
Method Detail
-
getCapabilities
java.util.List<Capability> getCapabilities(java.lang.String namespace)
Returns the capabilities declared by this resource.- Parameters:
namespace
- The namespace of the declared capabilities to return ornull
to return the declared capabilities from all namespaces.- Returns:
- An unmodifiable list containing the declared
Capability
s from the specified namespace. The returned list will be empty if this resource declares no capabilities in the specified namespace.
-
getRequirements
java.util.List<Requirement> getRequirements(java.lang.String namespace)
Returns the requirements declared by this bundle resource.- Parameters:
namespace
- The namespace of the declared requirements to return ornull
to return the declared requirements from all namespaces.- 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.
-
equals
boolean equals(java.lang.Object obj)
Compares thisResource
to anotherResource
.This
Resource
is equal to anotherResource
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.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- The object to compare against thisResource
.- Returns:
true
if thisResource
is equal to the other object;false
otherwise.
-
hashCode
int hashCode()
Returns the hashCode of thisResource
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The hashCode of this
Resource
.
-
-