Class SubRequestIteratorSupport<S extends SubRequest<?>>

    • Constructor Detail

      • SubRequestIteratorSupport

        public SubRequestIteratorSupport​(Iterator<?> subRequests)
        Creates a SubRequestIterator that decorates an Iterator.
        Parameters:
        subRequests - an Iterator on SubRequest instances or instances of other objects if mapToSubRequest(Object element) is implemented (overwritten) accordingly.
    • Method Detail

      • hasNext

        public boolean hasNext()
        Description copied from interface: SubRequestIterator
        Returns true if there are more sub-requests to process. In other words, returns true if next would return an element rather than throwing an exception.
        Specified by:
        hasNext in interface Iterator<S extends SubRequest<?>>
        Specified by:
        hasNext in interface SubRequestIterator<S extends SubRequest<?>>
        Returns:
        true if there are more sub-requests.
      • mapToSubRequest

        protected S mapToSubRequest​(Object element)
        Returns the SubRequest contained or represented by the supplied object (element of the iterator). The default implementation simply casts the supplied object to SubRequest.
        Parameters:
        element - an Object from which a SubRequest can be deduced.
        Returns:
        a SubRequest instance.