Class Providers


  • public class Providers
    extends Object
    The Providers class provides static methods for accessing providers.
    • Constructor Detail

      • Providers

        public Providers()
    • Method Detail

      • fromServiceLoader

        public static Iterable<ProviderMetadata> fromServiceLoader()
        Returns the providers located on the classpath via ServiceLoader.
        Returns:
        all available providers loaded from classpath via ServiceLoader
      • all

        public static Iterable<ProviderMetadata> all()
        Returns all available providers.
        Returns:
        all available providers
      • viewableAs

        public static Iterable<ProviderMetadata> viewableAs​(com.google.common.reflect.TypeToken<? extends View> viewableAs)
        Returns the providers that are of the provided viewableAs.
        Parameters:
        viewableAs - the viewableAs to providers to return
        Returns:
        the providers of the provided viewableAs
      • apiMetadataAssignableFrom

        public static Iterable<ProviderMetadata> apiMetadataAssignableFrom​(com.google.common.reflect.TypeToken<? extends ApiMetadata> api)
        Returns the providers that are of the provided api.
        Parameters:
        api - the api to providers to return
        Returns:
        the providers of the provided api
      • contextAssignableFrom

        public static <C extends ContextIterable<ProviderMetadata> contextAssignableFrom​(com.google.common.reflect.TypeToken<? extends Context> context)
        Returns the providers that are of the provided context.
        Parameters:
        context - the context to providers to return
        Returns:
        the providers of the provided context
      • boundedByIso3166Code

        public static Iterable<ProviderMetadata> boundedByIso3166Code​(String iso3166Code)
        Returns the providers that are bound to the same location as the given ISO 3166 code regardless of viewableAs.
        Parameters:
        isoCode - the ISO 3166 code to filter providers by
        Returns:
        the providers bound by the given ISO 3166 code
      • boundedByIso3166Code

        public static Iterable<ProviderMetadata> boundedByIso3166Code​(String iso3166Code,
                                                                      com.google.common.reflect.TypeToken<? extends View> viewableAs)
        Returns the providers that are bound to the same location as the given ISO 3166 code and of the given viewableAs.
        Parameters:
        iso3166Code - the ISO 3166 code to filter providers by
        viewableAs - the viewableAs to filter providers by
        Returns:
        the providers bound by the given ISO 3166 code and of the proper viewableAs
      • collocatedWith

        public static Iterable<ProviderMetadata> collocatedWith​(ProviderMetadata providerMetadata)
        Returns the providers that have at least one common ISO 3166 code in common regardless of viewableAs.
        Parameters:
        providerMetadata - the provider metadata to use to filter providers by
        Returns:
        the providers that share at least one common ISO 3166 code
      • collocatedWith

        public static Iterable<ProviderMetadata> collocatedWith​(ProviderMetadata providerMetadata,
                                                                com.google.common.reflect.TypeToken<? extends View> viewableAs)
        Returns the providers that have at least one common ISO 3166 code and are of the given viewableAs.
        Parameters:
        providerMetadata - the provider metadata to use to filter providers by
        viewableAs - the viewableAs to filter providers by
        Returns:
        the providers that share at least one common ISO 3166 code and of the given viewableAs