Search in sources :

Example 1 with Hoster

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;
}
Also used : HosterList(de.herrlock.manga.index.entity.HosterList) TreeSet(java.util.TreeSet) Hoster(de.herrlock.manga.host.Hoster) Index(de.herrlock.manga.index.entity.Index)

Aggregations

Hoster (de.herrlock.manga.host.Hoster)1 HosterList (de.herrlock.manga.index.entity.HosterList)1 Index (de.herrlock.manga.index.entity.Index)1 TreeSet (java.util.TreeSet)1