/** * instantiates the supplied classnames using the bundle classloader, and casts to the supplied type. Any errors are * silently ignored. * * @return instances that could be instantiated without error. */ public static <T> ImmutableSet<T> instantiateAvailableClasses(Bundle bundle, Iterable<String> classNames, Class<T> type) { checkNotNull(bundle, "bundle"); checkNotNull(classNames, "classNames"); checkNotNull(type, "type"); return FluentIterable.from(classNames) .transform(loadClassIfAssignableFrom(bundle, type)) .filter(notNull()) .transform(instantiateIfPossible(type)) .filter(notNull()) .toSet(); }
/** * instantiates the supplied classnames using the bundle classloader, and casts to the supplied type. Any errors are * silently ignored. * * @return instances that could be instantiated without error. */ public static <T> ImmutableSet<T> instantiateAvailableClasses(Bundle bundle, Iterable<String> classNames, Class<T> type) { checkNotNull(bundle, "bundle"); checkNotNull(classNames, "classNames"); checkNotNull(type, "type"); return FluentIterable.from(classNames) .transform(loadClassIfAssignableFrom(bundle, type)) .filter(notNull()) .transform(instantiateIfPossible(type)) .filter(notNull()) .toSet(); }
/** * instantiates the supplied classnames using the bundle classloader, and casts to the supplied type. Any errors are * silently ignored. * * @return instances that could be instantiated without error. */ public static <T> ImmutableSet<T> instantiateAvailableClasses(Bundle bundle, Iterable<String> classNames, Class<T> type) { checkNotNull(bundle, "bundle"); checkNotNull(classNames, "classNames"); checkNotNull(type, "type"); return FluentIterable.from(classNames) .transform(loadClassIfAssignableFrom(bundle, type)) .filter(notNull()) .transform(instantiateIfPossible(type)) .filter(notNull()) .toSet(); }
/** * instantiates the supplied classnames using the bundle classloader, and casts to the supplied type. Any errors are * silently ignored. * * @return instances that could be instantiated without error. */ public static <T> ImmutableSet<T> instantiateAvailableClasses(Bundle bundle, Iterable<String> classNames, Class<T> type) { checkNotNull(bundle, "bundle"); checkNotNull(classNames, "classNames"); checkNotNull(type, "type"); return FluentIterable.from(classNames) .transform(loadClassIfAssignableFrom(bundle, type)) .filter(notNull()) .transform(instantiateIfPossible(type)) .filter(notNull()) .toSet(); }
/** * instantiates the supplied classnames using the bundle classloader, and casts to the supplied type. Any errors are * silently ignored. * * @return instances that could be instantiated without error. */ public static <T> ImmutableSet<T> instantiateAvailableClasses(Bundle bundle, Iterable<String> classNames, Class<T> type) { checkNotNull(bundle, "bundle"); checkNotNull(classNames, "classNames"); checkNotNull(type, "type"); return FluentIterable.from(classNames) .transform(loadClassIfAssignableFrom(bundle, type)) .filter(notNull()) .transform(instantiateIfPossible(type)) .filter(notNull()) .toSet(); }
/** * instantiates the supplied classnames using the bundle classloader, and casts to the supplied type. Any errors are * silently ignored. * * @return instances that could be instantiated without error. */ public static <T> ImmutableSet<T> instantiateAvailableClasses(Bundle bundle, Iterable<String> classNames, Class<T> type) { checkNotNull(bundle, "bundle"); checkNotNull(classNames, "classNames"); checkNotNull(type, "type"); return FluentIterable.from(classNames) .transform(loadClassIfAssignableFrom(bundle, type)) .filter(notNull()) .transform(instantiateIfPossible(type)) .filter(notNull()) .toSet(); }