ItemSnapshotList

public final class ItemSnapshotList<T extends Object>


Snapshot of data being presented by a androidx.pagingAsyncPagingDataDiffer or a PagingDataAdapter.

Summary

Public fields

final @NonNull List<@NonNull T>

The presented data, excluding placeholders.

final int

Number of placeholders after the presented items, 0 if enablePlaceholders is false.

final int

Number of placeholders before the presented items, 0 if enablePlaceholders is false.

int

Size of ItemSnapshotList including placeholders.

Public constructors

<T extends Object> ItemSnapshotList(
    @IntRange(from = 0) int placeholdersBefore,
    @IntRange(from = 0) int placeholdersAfter,
    @NonNull List<@NonNull T> items
)

Public methods

@Nullable T
get(int index)

Returns the item at index, where index includes the position of placeholders.

Inherited methods

From class AbstractCollection
boolean
contains(@Nullable T element)
boolean
boolean
@NonNull String
From class AbstractList
boolean
int
int
indexOf(@Nullable T element)
@NonNull Iterator<@NonNull T>
int
lastIndexOf(@Nullable T element)
@NonNull ListIterator<@NonNull T>
@NonNull ListIterator<@NonNull T>
listIterator(int index)
@NonNull List<@NonNull T>
subList(int fromIndex, int toIndex)
From class Collection
From class Iterable

Public fields

items

@NonNull
public final @NonNull List<@NonNull T> items

The presented data, excluding placeholders.

placeholdersAfter

@NonNull
public final int placeholdersAfter

Number of placeholders after the presented items, 0 if enablePlaceholders is false.

placeholdersBefore

@NonNull
public final int placeholdersBefore

Number of placeholders before the presented items, 0 if enablePlaceholders is false.

size

@NonNull
public int size

Size of