PositionalDataSource.LoadRangeCallback

public abstract class PositionalDataSource.LoadRangeCallback<T extends Object>


Callback for PositionalDataSource loadRange to return data.

A callback should be called only once, and may throw if called again.

It is always valid for a DataSource loading method that takes a callback to stash the callback and call it later. This enables DataSources to be fully asynchronous, and to handle temporary, recoverable error states (such as a network error that can be retried).

Parameters
<T extends Object>

Type of items being loaded.

Summary

Public constructors

<T extends Object> LoadRangeCallback()

Public methods

abstract void

Called to pass loaded data from loadRange.

Public constructors

LoadRangeCallback

@NonNull
public final <T extends Object> LoadRangeCallback()
Parameters
<T extends Object>

Type of items being loaded.

Public methods

onResult

@NonNull
public abstract void onResult(@NonNull List<@NonNull T> data)

Called to pass loaded data from loadRange.

Parameters
@NonNull List<@NonNull T> data

List of items loaded from the DataSource. Must be same size as requested, unless at end of list.