Class ResourcesRepository

java.lang.Object
aQute.bnd.osgi.repository.BaseRepository
aQute.bnd.osgi.repository.ResourcesRepository
All Implemented Interfaces:
Tagged, org.osgi.service.repository.Repository

public class ResourcesRepository extends BaseRepository
A repository that contains a set of resources.
  • Field Summary

    Fields inherited from interface org.osgi.service.repository.Repository

    URL

    Fields inherited from interface Tagged

    EMPTY_TAGS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates 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 Type
    Method
    Description
    void
    add(org.osgi.resource.Resource resource)
    Adds a resource to this repository.
    void
    addAll(Collection<? extends org.osgi.resource.Resource> resources)
    Adds a collection of resources to this repository.
    boolean
    contains(org.osgi.resource.Resource resource)
    Tests whether the supplied resources is contained in this repository
    List<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 void
    set(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.
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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

      public ResourcesRepository(Collection<? extends org.osgi.resource.Resource> resources)
      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

      public List<org.osgi.resource.Capability> findProvider(org.osgi.resource.Requirement requirement)
      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

      public void addAll(Collection<? extends org.osgi.resource.Resource> resources)
      Adds a collection of resources to this repository.
      Parameters:
      resources - The resources to add.
    • set

      protected void set(Collection<? extends org.osgi.resource.Resource> resources)
      Sets the resources in this repository to the specified collection of resources.
      Parameters:
      resources - The resources to set.
    • getResources

      public List<org.osgi.resource.Resource> 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

      public static Collector<org.osgi.resource.Capability, List<org.osgi.resource.Capability>, List<org.osgi.resource.Capability>> toCapabilities()
      Returns a collector that accumulates capabilities into a list.
      Returns:
      A collector that accumulates capabilities into a list.
    • 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

      public String toString()
      Overrides:
      toString in class Object