-
public final class ItemDiffCallback<T extends Object> extends DiffUtil.ItemCallback<T>
-
-
Constructor Summary
Constructors Constructor Description ItemDiffCallback()
-
Method Summary
Modifier and Type Method Description BooleanareItemsTheSame(T oldItem, T newItem)Called to check whether two objects represent the same item. BooleanareContentsTheSame(T oldItem, T newItem)This information is used to detect if the contents of an item have changed. ObjectgetChangePayload(T oldItem, T newItem)When {@link #areItemsTheSame(int, int)} returns {@code true} for two items and {@link #areContentsTheSame(int, int)} returns false for them, DiffUtil calls this method to get a payload about the change. -
-
Method Detail
-
areItemsTheSame
Boolean areItemsTheSame(T oldItem, T newItem)
Called to check whether two objects represent the same item. For example, if your items have unique ids, this method should check their id equality.
-
areContentsTheSame
Boolean areContentsTheSame(T oldItem, T newItem)
This information is used to detect if the contents of an item have changed.
-
getChangePayload
Object getChangePayload(T oldItem, T newItem)
When {@link #areItemsTheSame(int, int)} returns {@code true} for two items and {@link #areContentsTheSame(int, int)} returns false for them, DiffUtil calls this method to get a payload about the change.
-
-
-
-