Class LazyResourceCollectionWrapper

All Implemented Interfaces:
Cloneable, Iterable<Resource>, ResourceCollection

public class LazyResourceCollectionWrapper extends AbstractResourceCollectionWrapper
Resource collection which load underlying resource collection only on demand with support for caching
  • Constructor Details

    • LazyResourceCollectionWrapper

      public LazyResourceCollectionWrapper()
  • Method Details

    • createIterator

      protected Iterator<Resource> createIterator()
      Description copied from class: AbstractResourceCollectionWrapper
      Do create an iterator on the resource collection. The creation of the iterator is allowed to not be thread safe whereas the iterator itself should. The returned iterator will be wrapped into the FailFast one.
      Specified by:
      createIterator in class AbstractResourceCollectionWrapper
      Returns:
      the iterator on the resource collection
    • getSize

      protected int getSize()
      Description copied from class: AbstractResourceCollectionWrapper
      Do compute the size of the resource collection. The implementation of this function is allowed to be not thread safe.
      Specified by:
      getSize in class AbstractResourceCollectionWrapper
      Returns:
      size of resource collection.
    • filterResource

      protected boolean filterResource(Resource r)
      Specify if the resource should be filtered or not. This function should be overridden in order to define the filtering algorithm
      Parameters:
      r - resource considered for filtration
      Returns:
      whether the resource should be filtered or not