/** * gets all sub types in hierarchy of a given type * * <p>depends on SubTypesScanner configured */ public <T> Set<Class<? extends T>> getSubTypesOf(final Class<T> type) { return Sets.newHashSet( ReflectionUtils.<T>forNames( store.getAll(index(SubTypesScanner.class), Arrays.asList(type.getName())), loaders())); }
/** * gets all sub types in hierarchy of a given type * * <p>depends on SubTypesScanner configured, otherwise an empty set is returned */ public <T> Set<Class<? extends T>> getSubTypesOf(final Class<T> type) { Set<String> subTypes = store.getSubTypesOf(type.getName()); return ImmutableSet.copyOf(ReflectionUtils.<T>forNames(subTypes)); }