CombinedLoadStates

public final class CombinedLoadStates


Collection of pagination LoadStates for both a PagingSource, and RemoteMediator.

Note: The REFRESHLoadType.REFRESH always has LoadState.endOfPaginationReached set to false.

Summary

Public fields

final @NonNull LoadState

Convenience for combined behavior of APPENDLoadState, which generally defers to mediator if it exists, but if previously was LoadState.Loading, awaits for both source and mediator to become LoadState.NotLoading to ensure the remote load was applied.

final LoadStates

LoadStates corresponding to loads from a RemoteMediator, or null if RemoteMediator not present.

final @NonNull LoadState

Convenience for combined behavior of PREPENDLoadState, which generally defers to mediator if it exists, but if previously was LoadState.Loading, awaits for both source and mediator to become LoadState.NotLoading to ensure the remote load was applied.

final @NonNull LoadState

Convenience for combined behavior of REFRESHLoadState, which generally defers to mediator if it exists, but if previously was LoadState.Loading, awaits for both source and mediator to become LoadState.NotLoading to ensure the remote load was applied.

final @NonNull LoadStates

LoadStates corresponding to loads from a PagingSource.

Public constructors

CombinedLoadStates(
    LoadState refresh,
    LoadState prepend,
    LoadState append,
    LoadStates source,
    LoadStates mediator
)

Public methods

boolean
equals(Object other)
int
@NonNull String

Public fields

append

public final @NonNull LoadState append

Convenience for combined behavior of APPENDLoadState, which generally defers to mediator if it exists, but if previously was LoadState.Loading, awaits for both source and mediator to become LoadState.NotLoading to ensure the remote load was applied.

For use cases that require reacting to LoadState of source and mediator specifically, e.g., showing cached data when network loads via mediator fail, LoadStates exposed via source and mediator should be used directly.

mediator

public final LoadStates mediator

LoadStates corresponding to loads from a RemoteMediator, or null if RemoteMediator not present.

prepend

public final @NonNull LoadState prepend

Convenience for combined behavior of PREPENDLoadState, which generally defers to mediator if it exists, but if previously was LoadState.Loading, awaits for both source and mediator to become LoadState.NotLoading to ensure the remote load was applied.

For use cases that require reacting to LoadState of source and mediator specifically, e.g., showing cached data when network loads via mediator fail, LoadStates exposed via source and mediator should be used directly.

refresh

public final @NonNull LoadState refresh

Convenience for combined behavior of REFRESHLoadState, which generally defers to mediator if it exists, but if previously was LoadState.Loading, awaits for both source and mediator to become LoadState.NotLoading to ensure the remote load was applied.

For use cases that require reacting to LoadState of source and mediator specifically, e.g., showing cached data when network loads via mediator fail, LoadStates exposed via source and mediator should be used directly.

source

public final @NonNull LoadStates source

LoadStates corresponding to loads from a PagingSource.

Public constructors

CombinedLoadStates

public final CombinedLoadStates(
    LoadState refresh,
    LoadState prepend,
    LoadState append,
    LoadStates source,
    LoadStates mediator
)

Public methods

equals

public boolean equals(Object other)

hashCode

public int hashCode()

toString

public @NonNull String toString()