public final class

AsyncDifferConfig.Builder<T>

extends java.lang.Object

 java.lang.Object

↳androidx.recyclerview.widget.AsyncDifferConfig.Builder<T>

Overview

Builder class for AsyncDifferConfig.

Summary

Constructors
publicBuilder(DiffUtil.ItemCallback<java.lang.Object> diffCallback)

Methods
public AsyncDifferConfig<java.lang.Object>build()

Creates a AsyncListDiffer with the given parameters.

public AsyncDifferConfig.Builder<java.lang.Object>setBackgroundThreadExecutor(java.util.concurrent.Executor executor)

If provided, defines the background executor used to calculate the diff between an old and a new list.

public AsyncDifferConfig.Builder<java.lang.Object>setMainThreadExecutor(java.util.concurrent.Executor executor)

If provided, defines the main thread executor used to dispatch adapter update notifications on the main thread.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(DiffUtil.ItemCallback<java.lang.Object> diffCallback)

Methods

public AsyncDifferConfig.Builder<java.lang.Object> setMainThreadExecutor(java.util.concurrent.Executor executor)

If provided, defines the main thread executor used to dispatch adapter update notifications on the main thread.

If not provided or null, it will default to the main thread.

Parameters:

executor: The executor which can run tasks in the UI thread.

Returns:

this

public AsyncDifferConfig.Builder<java.lang.Object> setBackgroundThreadExecutor(java.util.concurrent.Executor executor)

If provided, defines the background executor used to calculate the diff between an old and a new list.

If not provided or null, defaults to two thread pool executor, shared by all ListAdapterConfigs.

Parameters:

executor: The background executor to run list diffing.

Returns:

this

public AsyncDifferConfig<java.lang.Object> build()

Creates a AsyncListDiffer with the given parameters.

Returns:

A new AsyncDifferConfig.