Class InfoItemsCollector<I extends InfoItem,​E extends InfoItemExtractor>

    • Constructor Summary

      Constructors 
      Constructor Description
      InfoItemsCollector​(int serviceId)
      Create a new collector with no comparator / sorting function
      InfoItemsCollector​(int serviceId, java.util.Comparator<I> comparator)
      Create a new collector
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addError​(java.lang.Exception error)
      Add an error
      protected void addItem​(I item)
      Add an item
      void commit​(E extractor)
      Try to add an extractor to the collection
      java.util.List<java.lang.Throwable> getErrors()
      Get all errors
      java.util.List<I> getItems()
      Get all items
      int getServiceId()
      Get the service id
      void reset()
      Reset all collected items and errors
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InfoItemsCollector

        public InfoItemsCollector​(int serviceId)
        Create a new collector with no comparator / sorting function
        Parameters:
        serviceId - the service id
      • InfoItemsCollector

        public InfoItemsCollector​(int serviceId,
                                  @Nullable
                                  java.util.Comparator<I> comparator)
        Create a new collector
        Parameters:
        serviceId - the service id
    • Method Detail

      • addError

        protected void addError​(java.lang.Exception error)
        Add an error
        Parameters:
        error - the error
      • addItem

        protected void addItem​(I item)
        Add an item
        Parameters:
        item - the item
      • getServiceId

        public int getServiceId()
        Get the service id
        Returns:
        the service id
      • commit

        public void commit​(E extractor)
        Description copied from interface: Collector
        Try to add an extractor to the collection
        Specified by:
        commit in interface Collector<I extends InfoItem,​E extends InfoItemExtractor>
        Parameters:
        extractor - the extractor to add