Class MapPaginatorTransformItem<K,I,O>
java.lang.Object
org.aksw.commons.rx.lookup.MapPaginatorTransformItem<K,I,O>
- Type Parameters:
K-I-O-
- All Implemented Interfaces:
Function<com.google.common.collect.Range<Long>, io.reactivex.rxjava3.core.Flowable<Map.Entry<K,O>>>, ListPaginator<Map.Entry<K, O>>, MapPaginator<K, O>, RangedEntrySupplier<Long, K, O>, RangedSupplier<Long, Map.Entry<K, O>>, Unwrappable
FIXME Possibly extend with generic transform instead of just value
- Author:
- raven
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected MapPaginator<K, I> protected BiFunction<? super K, ? super I, ? extends O> -
Constructor Summary
ConstructorsConstructorDescriptionMapPaginatorTransformItem(MapPaginator<K, I> delegate, BiFunction<? super K, ? super I, ? extends O> fnTransformItem) -
Method Summary
Modifier and TypeMethodDescription/ Map<K, O> result = new LinkedHashMap<K, O>(); / for(Entry<K, I> entry : map.entrySet()) { / K k = entry.getKey(); / I i = entry.getValue(); / O o = fnTransformItem.apply(i); / / result.put(k, o); / }static <K,I, O> MapPaginatorTransformItem <K, I, O> create(MapPaginator<K, I> listService, BiFunction<? super K, ? super I, ? extends O> fnTransformItem) io.reactivex.rxjava3.core.Single<com.google.common.collect.Range<Long>> fetchCount(Long itemLimit, Long rowLimit) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ListPaginator
batch, fetchList, mapMethods inherited from interface MapPaginator
fetchMap, fetchMap, toMap, toMapMethods inherited from interface Unwrappable
unwrap
-
Field Details
-
delegate
-
fnTransformItem
-
-
Constructor Details
-
MapPaginatorTransformItem
public MapPaginatorTransformItem(MapPaginator<K, I> delegate, BiFunction<? super K, ? super I, ? extends O> fnTransformItem)
-
-
Method Details
-
apply
public io.reactivex.rxjava3.core.Flowable<Map.Entry<K,O>> apply(com.google.common.collect.Range<Long> range) / Map<K, O> result = new LinkedHashMap<K, O>(); / for(Entry<K, I> entry : map.entrySet()) { / K k = entry.getKey(); / I i = entry.getValue(); / O o = fnTransformItem.apply(i); / / result.put(k, o); / } -
fetchCount
public io.reactivex.rxjava3.core.Single<com.google.common.collect.Range<Long>> fetchCount(Long itemLimit, Long rowLimit) - Specified by:
fetchCountin interfaceListPaginator<K>
-
create
public static <K,I, MapPaginatorTransformItem<K,O> I, createO> (MapPaginator<K, I> listService, BiFunction<? super K, ? super I, ? extends O> fnTransformItem)
-