Class ListPaginatorWithSimpleCache<T>
java.lang.Object
org.aksw.commons.util.delegate.AbstractDelegated<RangedSupplier<Long,T>>
org.aksw.commons.rx.range.RangedSupplierDelegated<Long,T>
org.aksw.commons.rx.cache.range.ListPaginatorWithSimpleCache<T>
- All Implemented Interfaces:
Function<com.google.common.collect.Range<Long>, io.reactivex.rxjava3.core.Flowable<T>>, ListPaginator<T>, RangedSupplier<Long,T>, Delegated<RangedSupplier<Long, T>>, Unwrappable
public class ListPaginatorWithSimpleCache<T>
extends RangedSupplierDelegated<Long,T>
implements ListPaginator<T>
A cache that upon any item or count request caches the full range of data
into a (java) List and subsequently serves the request from the cache.
This class performs only at most a single request to the delegate's apply method.
- Author:
- raven
-
Field Summary
FieldsFields inherited from class AbstractDelegated
delegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Flowable<T> io.reactivex.rxjava3.core.Single<com.google.common.collect.Range<Long>> fetchCount(Long itemLimit, Long rowLimit) static <V> ListPaginator<V> wrap(ListPaginator<V> backend) Methods inherited from class AbstractDelegated
delegate, equals, hashCode, toStringMethods inherited from interface ListPaginator
batch, fetchList, mapMethods inherited from interface Unwrappable
unwrap
-
Field Details
-
cache
-
-
Constructor Details
-
ListPaginatorWithSimpleCache
-
-
Method Details
-
fetchCount
public io.reactivex.rxjava3.core.Single<com.google.common.collect.Range<Long>> fetchCount(Long itemLimit, Long rowLimit) - Specified by:
fetchCountin interfaceListPaginator<T>- Parameters:
itemLimit- This argument is ignoredrowLimit- This argument is Ignored
-
apply
-
wrap
-