Class ResourcesRepository
java.lang.Object
aQute.bnd.osgi.repository.BaseRepository
aQute.bnd.osgi.repository.ResourcesRepository
- All Implemented Interfaces:
Tagged, org.osgi.service.repository.Repository
A repository that contains a set of resources.
-
Field Summary
Fields inherited from interface org.osgi.service.repository.Repository
URLFields inherited from interface Tagged
EMPTY_TAGS -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new resources repository with an empty set of resources.ResourcesRepository(Collection<? extends org.osgi.resource.Resource> resources) Creates a new resources repository with a collection of resources.ResourcesRepository(org.osgi.resource.Resource resource) Creates a new resources repository with a single resource. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(org.osgi.resource.Resource resource) Adds a resource to this repository.voidaddAll(Collection<? extends org.osgi.resource.Resource> resources) Adds a collection of resources to this repository.booleancontains(org.osgi.resource.Resource resource) Tests whether the supplied resources is contained in this repositoryList<org.osgi.resource.Capability> findProvider(org.osgi.resource.Requirement requirement) Finds the providers of the specified requirement in this repository.Map<org.osgi.resource.Requirement, Collection<org.osgi.resource.Capability>> findProviders(Collection<? extends org.osgi.resource.Requirement> requirements) Finds all the providers of the specified requirements in this repository.List<org.osgi.resource.Resource> Gets a list of all the resources in this repository.protected voidset(Collection<? extends org.osgi.resource.Resource> resources) Sets the resources in this repository to the specified collection of resources.static Collector<org.osgi.resource.Capability, List<org.osgi.resource.Capability>, List<org.osgi.resource.Capability>> Returns a collector that accumulates capabilities into a list.static Collector<org.osgi.resource.Resource, ResourcesRepository, ResourcesRepository> Returns a collector that accumulates resources into a resources repository.toString()Methods inherited from class BaseRepository
findProviders, getExpressionCombiner, getTags, newRequirementBuilder, setTags
-
Constructor Details
-
ResourcesRepository
public ResourcesRepository()Creates a new resources repository with an empty set of resources. -
ResourcesRepository
public ResourcesRepository(org.osgi.resource.Resource resource) Creates a new resources repository with a single resource.- Parameters:
resource- The resource to add to the repository.
-
ResourcesRepository
Creates a new resources repository with a collection of resources.- Parameters:
resources- The resources to add to the repository.
-
-
Method Details
-
findProviders
public Map<org.osgi.resource.Requirement, Collection<org.osgi.resource.Capability>> findProviders(Collection<? extends org.osgi.resource.Requirement> requirements) Finds all the providers of the specified requirements in this repository.- Parameters:
requirements- The requirements to find providers for.- Returns:
- A map of requirements to the providers that satisfy them.
-
findProvider
Finds the providers of the specified requirement in this repository.- Parameters:
requirement- The requirement to find providers for.- Returns:
- A list of capabilities that satisfy the requirement.
-
add
public void add(org.osgi.resource.Resource resource) Adds a resource to this repository.- Parameters:
resource- The resource to add.
-
addAll
Adds a collection of resources to this repository.- Parameters:
resources- The resources to add.
-
set
Sets the resources in this repository to the specified collection of resources.- Parameters:
resources- The resources to set.
-
getResources
Gets a list of all the resources in this repository.- Returns:
- A list of all the resources in this repository.
-
contains
public boolean contains(org.osgi.resource.Resource resource) Tests whether the supplied resources is contained in this repository- Parameters:
resource- the resource to test- Returns:
- true if this resource is already part of this ResourcesRepository
-
toCapabilities
-
toResourcesRepository
public static Collector<org.osgi.resource.Resource, ResourcesRepository, ResourcesRepository> toResourcesRepository()Returns a collector that accumulates resources into a resources repository.- Returns:
- A collector that accumulates resources into a resources repository.
-
toString
-