/** * Get the iterable of all providers (custom and default) registered for the given service provider contract * in the underlying {@link InjectionManager injection manager} container ordered based on the given {@code comparator}. * * @param <T> service provider contract Java type. * @param injectionManager underlying injection manager. * @param contract service provider contract. * @param comparator comparator to be used for sorting the returned providers. * @return set of all available service provider instances for the contract ordered using the given * {@link Comparator comparator}. */ public static <T> Iterable<T> getAllProviders( InjectionManager injectionManager, Class<T> contract, Comparator<T> comparator) { List<T> providerList = new ArrayList<>(getProviderClasses(getAllServiceHolders(injectionManager, contract))); if (comparator != null) { providerList.sort(comparator); } return providerList; }
/** * Get the iterable of all providers (custom and default) registered for the given service provider contract * in the underlying {@link InjectionManager injection manager} container ordered based on the given {@code comparator}. * * @param <T> service provider contract Java type. * @param injectionManager underlying injection manager. * @param contract service provider contract. * @param comparator comparator to be used for sorting the returned providers. * @return set of all available service provider instances for the contract ordered using the given * {@link Comparator comparator}. */ public static <T> Iterable<T> getAllProviders( InjectionManager injectionManager, Class<T> contract, Comparator<T> comparator) { List<T> providerList = new ArrayList<>(getProviderClasses(getAllServiceHolders(injectionManager, contract))); if (comparator != null) { providerList.sort(comparator); } return providerList; }
return Values.lazy((Value<Set<ExceptionMapperType>>) () -> { Collection<ServiceHolder<ExceptionMapper>> mapperHandles = Providers.getAllServiceHolders(injectionManager, ExceptionMapper.class);
return Values.lazy((Value<Set<ExceptionMapperType>>) () -> { Collection<ServiceHolder<ExceptionMapper>> mapperHandles = Providers.getAllServiceHolders(injectionManager, ExceptionMapper.class);
/** * Get the iterable of all providers (custom and default) registered for the given service provider contract * in the underlying {@link InjectionManager injection manager} container ordered based on the given {@code comparator}. * * @param <T> service provider contract Java type. * @param injectionManager underlying injection manager. * @param contract service provider contract. * @param comparator comparator to be used for sorting the returned providers. * @return set of all available service provider instances for the contract ordered using the given * {@link Comparator comparator}. */ public static <T> Iterable<T> getAllProviders( InjectionManager injectionManager, Class<T> contract, Comparator<T> comparator) { List<T> providerList = new ArrayList<>(getProviderClasses(getAllServiceHolders(injectionManager, contract))); if (comparator != null) { providerList.sort(comparator); } return providerList; }
/** * Get the iterable of all providers (custom and default) registered for the given service provider contract * in the underlying {@link InjectionManager injection manager} container ordered based on the given {@code comparator}. * * @param <T> service provider contract Java type. * @param injectionManager underlying injection manager. * @param contract service provider contract. * @param comparator comparator to be used for sorting the returned providers. * @return set of all available service provider instances for the contract ordered using the given * {@link Comparator comparator}. */ public static <T> Iterable<T> getAllProviders( InjectionManager injectionManager, Class<T> contract, Comparator<T> comparator) { List<T> providerList = new ArrayList<>(getProviderClasses(getAllServiceHolders(injectionManager, contract))); if (comparator != null) { providerList.sort(comparator); } return providerList; }
return Values.lazy((Value<Set<ExceptionMapperType>>) () -> { Collection<ServiceHolder<ExceptionMapper>> mapperHandles = Providers.getAllServiceHolders(injectionManager, ExceptionMapper.class);
return Values.lazy((Value<Set<ExceptionMapperType>>) () -> { Collection<ServiceHolder<ExceptionMapper>> mapperHandles = Providers.getAllServiceHolders(injectionManager, ExceptionMapper.class);