package com.ruoyi.common.utils.collection;

import lombok.Data;

import java.util.List;

/**
 * 新旧差异列表
 * @author wjh
 * 2024/11/2
 */
@Data
public class DiffListVO<N, O> {
    List<N> addList;
    List<N> updateList;
    List<O> delList;

    public DiffListVO<N,O> setAdd(List<N> list) {
        this.addList = list;
        return this;
    }
    public DiffListVO<N,O> setUpdate(List<N> list) {
        this.updateList = list;
        return this;
    }
    public DiffListVO<N,O> setDel(List<O> list) {
        this.delList = list;
        return this;
    }
    public int getAddCount() {
        return CollectionUtils.isEmptyElement(addList) ? 0 : addList.size();
    }
    public int getUpdateCount() {
        return CollectionUtils.isEmptyElement(updateList) ? 0 : updateList.size();
    }
    public int getDelCount() {
        return CollectionUtils.isEmptyElement(delList) ? 0 : delList.size();
    }
}
