Class AbstractComponentRepository<K,C extends Component<K>,F extends ComponentFactory<K,C>>

java.lang.Object
org.n52.janmayen.component.AbstractComponentRepository<K,C,F>
Type Parameters:
K - the component key type
C - the component type
F - the component factory type
Direct Known Subclasses:
AbstractSimilarityKeyComponentRepository

public abstract class AbstractComponentRepository<K,C extends Component<K>,F extends ComponentFactory<K,C>> extends Object
Abstract class to encapsulate the loading of implementations that are registered with the ServiceLoader interface.
Since:
1.0.0
  • Constructor Details

    • AbstractComponentRepository

      public AbstractComponentRepository()
  • Method Details

    • getProviders

      protected Map<K,Set<Producer<C>>> getProviders(Optional<? extends Collection<? extends C>> components, Optional<? extends Collection<? extends F>> factories)
      Create a multi valued map with Producers for the supplied components and factories.
      Parameters:
      components - the component instances
      factories - the component factories
      Returns:
      the producers
    • getProviders

      protected Map<K,Set<Producer<C>>> getProviders(Collection<? extends C> components, Collection<? extends F> factories)
      Create a multi valued map with Producers for the supplied components and factories.
      Parameters:
      components - the component instances (may be null or empty)
      factories - the component factories (may be null or empty)
      Returns:
      the producers
    • getUniqueProviders

      protected Map<K,Producer<C>> getUniqueProviders(Optional<? extends Collection<? extends C>> components, Optional<? extends Collection<? extends F>> factories)
      Create a map with Producers for the supplied components and factories. Components or factories with the same keys are discarded.
      Parameters:
      components - the component instances
      factories - the component factories
      Returns:
      the producers
    • getUniqueProviders

      protected Map<K,Producer<C>> getUniqueProviders(Collection<? extends C> components, Collection<? extends F> factories)
      Create a map with Producers for the supplied components and factories. Components or factories with the same keys are discarded.
      Parameters:
      components - the component instances (may be null or empty)
      factories - the component factories (may be null or empty)
      Returns:
      the producers