Package 

Class ItemDiffCallback

    • Method Summary

      Modifier and Type Method Description
      Boolean areItemsTheSame(T oldItem, T newItem) Called to check whether two objects represent the same item.
      Boolean areContentsTheSame(T oldItem, T newItem) This information is used to detect if the contents of an item have changed.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ItemDiffCallback

        ItemDiffCallback()
    • 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.