Interface Collector<I,E>

Type Parameters:
I - the item type
E - the extractor type
All Known Implementing Classes:
ChannelInfoItemsCollector, CommentsInfoItemsCollector, InfoItemsCollector, MultiInfoItemsCollector, PlaylistInfoItemsCollector, StreamInfoItemsCollector

public interface Collector<I,E>
Collectors are used to simplify the collection of information from extractors
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    commit(E extractor)
    Try to add an extractor to the collection
    extract(E extractor)
    Try to extract the item from an extractor without adding it to the collection
    Get all errors
    Get all items
    void
    Reset all collected items and errors
  • Method Details

    • commit

      void commit(E extractor)
      Try to add an extractor to the collection
      Parameters:
      extractor - the extractor to add
    • extract

      I extract(E extractor) throws ParsingException
      Try to extract the item from an extractor without adding it to the collection
      Parameters:
      extractor - the extractor to use
      Returns:
      the item
      Throws:
      ParsingException - thrown if there is an error extracting the required fields of the item.
    • getItems

      List<I> getItems()
      Get all items
      Returns:
      the items
    • getErrors

      List<Throwable> getErrors()
      Get all errors
      Returns:
      the errors
    • reset

      void reset()
      Reset all collected items and errors