cn.schoolwow.util.domain.compare.instanceList.CompareInstanceList Maven / Gradle / Ivy
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);
}
}