All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.schoolwow.util.domain.compare.instanceList.CompareInstanceList Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
package cn.schoolwow.util.domain.compare.instanceList;

import cn.schoolwow.util.module.compare.instanceList.domain.CompareInstanceListQueryOption;
import org.apache.commons.lang3.Validate;

import java.util.List;

public class CompareInstanceList {
    private CompareInstanceListQueryOption compareInstanceListQueryOption = new CompareInstanceListQueryOption();

    /**创建实例查询*/
    public static CompareInstanceList newInstance(){
        CompareInstanceList compareInstanceList = new CompareInstanceList();
        return compareInstanceList;
    }

    /**设置修改前的列表*/
    public CompareInstanceList beforeInstanceList(List beforeInstanceList){
        compareInstanceListQueryOption.beforeInstanceList = beforeInstanceList;
        return this;
    }

    /**设置修改后的列表*/
    public CompareInstanceList afterInstanceList(List afterInstanceList){
        compareInstanceListQueryOption.afterInstanceList = afterInstanceList;
        return this;
    }

    /**检查是否新增时的唯一字段*/
    public CompareInstanceList addCheckFieldNames(String[] addCheckFieldNames){
        compareInstanceListQueryOption.addCheckFieldNames = addCheckFieldNames;
        return this;
    }

    /**检查是否更新时的唯一字段*/
    public CompareInstanceList updateCheckFieldNames(String[] updateCheckFieldNames){
        compareInstanceListQueryOption.updateCheckFieldNames = updateCheckFieldNames;
        return this;
    }

    public CompareInstanceListResponse execute(){
        Validate.notNull(compareInstanceListQueryOption.beforeInstanceList, "修改前的列表不能为空");
        Validate.notNull(compareInstanceListQueryOption.afterInstanceList, "修改后的列表不能为空");
        Validate.notNull(compareInstanceListQueryOption.addCheckFieldNames, "检查是否新增时的唯一字段不能为空");
        Validate.notNull(compareInstanceListQueryOption.updateCheckFieldNames, "检查是否更新时的唯一字段不能为空");
        return new CompareInstanceListResponse(compareInstanceListQueryOption);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy