package com.all.pdfreader.pro.app.util

import androidx.recyclerview.widget.DiffUtil
import com.all.pdfreader.pro.app.room.entity.PdfDocumentEntity

/**
 * 用于PdfDocumentEntity数据类的PdfDiff
 */
class PdfDiffCallback : DiffUtil.ItemCallback<PdfDocumentEntity>() {
    override fun areItemsTheSame(oldItem: PdfDocumentEntity, newItem: PdfDocumentEntity): Boolean {
        return oldItem.filePath == newItem.filePath
    }

    override fun areContentsTheSame(
        oldItem: PdfDocumentEntity,
        newItem: PdfDocumentEntity
    ): Boolean {
        return oldItem == newItem
    }
}
