use of de.herrlock.manga.host.Hoster in project Manga by herrlock.
the class Indexer method createIndex.
public static Index createIndex(final IndexerConfiguration conf) {
logger.traceEntry("({})", conf);
Iterable<Hoster> values;
if (conf.getUrl() == null) {
values = Hosters.values();
} else {
values = ImmutableSet.of(Hosters.tryGetHostByURL(conf.getUrl()));
}
Collection<HosterList> hosterEntries = new TreeSet<>(HosterList.HOSTER_NAME_COMPARATOR);
for (Hoster hoster : values) {
HosterList indexFor = createIndexFor(hoster, conf);
hosterEntries.add(indexFor);
}
Index index = new Index();
index.setHosters(hosterEntries);
return index;
}
Aggregations