Package org.osgi.resource
Interface Requirement
-
- All Known Subinterfaces:
BundleRequirement
@ConsumerType public interface Requirement
A requirement that has been declared from aResource
.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 thisRequirement
to anotherRequirement
.java.util.Map<java.lang.String,java.lang.Object>
getAttributes()
Returns the attributes of this requirement.java.util.Map<java.lang.String,java.lang.String>
getDirectives()
Returns the directives of this requirement.java.lang.String
getNamespace()
Returns the namespace of this requirement.Resource
getResource()
Returns the resource declaring this requirement.int
hashCode()
Returns the hashCode of thisRequirement
.
-
-
-
Method Detail
-
getNamespace
java.lang.String getNamespace()
Returns the namespace of this requirement.- Returns:
- The namespace of this requirement.
-
getDirectives
java.util.Map<java.lang.String,java.lang.String> getDirectives()
Returns the directives of this requirement.- Returns:
- An unmodifiable map of directive names to directive values for this requirement, or an empty map if this requirement has no directives.
-
getAttributes
java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Returns the attributes of this requirement.Requirement attributes have no specified semantics and are considered extra user defined information.
- Returns:
- An unmodifiable map of attribute names to attribute values for this requirement, or an empty map if this requirement has no attributes.
-
getResource
Resource getResource()
Returns the resource declaring this requirement.- Returns:
- The resource declaring this requirement. This can be
null
if this requirement is synthesized.
-
equals
boolean equals(java.lang.Object obj)
Compares thisRequirement
to anotherRequirement
.This
Requirement
is equal to anotherRequirement
if they have the same namespace, directives and attributes and are declared by the same resource.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- The object to compare against thisRequirement
.- Returns:
true
if thisRequirement
is equal to the other object;false
otherwise.
-
hashCode
int hashCode()
Returns the hashCode of thisRequirement
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The hashCode of this
Requirement
.
-
-