PagingData

public final class PagingData<T extends Object>


Container for Paged data from a single generation of loads.

Each refresh of data (generally either pushed by local storage, or pulled from the network) will have a separate corresponding PagingData.

Summary

Nested types

PagingData.Companion

Extension functions

final @NonNull PagingData<@NonNull T>
<T extends Object> PagingDataFutures.filterAsync(
    @NonNull PagingData<@NonNull T> receiver,
    @NonNull AsyncFunction<@NonNull T, @NonNull Boolean> predicate,
    @NonNull Executor executor
)

Returns a PagingData containing only elements matching the given predicate.

final @NonNull PagingData<@NonNull R>
<T extends Object, R extends Object> PagingDataFutures.flatMapAsync(
    @NonNull PagingData<@NonNull T> receiver,
    @NonNull AsyncFunction<@NonNull T, @NonNull Iterable<@NonNull R>> transform,
    @NonNull Executor executor
)

Returns a PagingData of all elements returned from applying the given transform to each element, as it is loaded.

final @NonNull PagingData<@NonNull R>
<T extends R, R extends Object> PagingDataFutures.insertSeparatorsAsync(
    @NonNull PagingData<@NonNull T> receiver,
    @NonNull AsyncFunction<@NonNull AdjacentItems<@NonNull T>, @NonNull R> generator,
    @NonNull Executor executor
)

Returns a PagingData containing each original element, with an optional separator generated by generator, given the elements before and after (or null, in boundary conditions).

final @NonNull PagingData<@NonNull R>
<T extends Object, R extends Object> PagingDataFutures.mapAsync(
    @NonNull PagingData<@NonNull T> receiver,
    @NonNull AsyncFunction<@NonNull T, @NonNull R> transform,
    @NonNull Executor executor
)

Returns a PagingData containing the result of applying the given transform to each element, as it is loaded.

final @NonNull PagingData<@NonNull T>
<T extends Object> PagingDataTransforms.filter(
    @NonNull PagingData<@NonNull T> receiver,
    @NonNull Executor executor,
    @NonNull Function1<@NonNull T, @NonNull Boolean> predicate
)

Returns a PagingData containing only elements matching the given predicate.

final @NonNull PagingData<@NonNull R>
<T extends Object, R extends Object> PagingDataTransforms.flatMap(
    @NonNull PagingData<@NonNull T> receiver,
    @NonNull Executor executor,
    @NonNull Function1<@NonNull T, @NonNull Iterable<@NonNull R>> transform
)

Returns a PagingData of all elements returned from applying the given transform to each element, as it is loaded.

final @NonNull PagingData<@NonNull T>
<T extends Object> PagingDataTransforms.insertFooterItem(
    @NonNull PagingData<@NonNull T> receiver,
    @NonNull TerminalSeparatorType terminalSeparatorType,
    @NonNull T item
)

Returns a PagingData containing each original element, with the passed footer item added to the end of the list.

final @NonNull PagingData<@NonNull T>
<T extends Object> PagingDataTransforms.insertHeaderItem(
    @NonNull PagingData<@NonNull T> receiver,
    @NonNull TerminalSeparatorType terminalSeparatorType,
    @NonNull T item
)