private static APIProvider initializeProvider() { // No need to check for emptiness as there is default implementation registered APIProvider p = ServiceLoader.load(APIProvider.class, Apis.class.getClassLoader()).iterator().next(); p.initialize(); return p; }
/** * Gets the API implementation based on Type * * @param <T> the API type * @param api the API implementation * @return the API implementation */ public static <T> T get(Class<T> api) { return provider.get(api); }