BeanFilterUtil
package com.yundaex.utility.bean.filter; import java.util.ArrayList;
import java.util.List; import org.apache.commons.lang.StringUtils; import com.yundaex.common.basic.comm.TransitentCommBasePO; public class BeanFilterUtil {
public static <T extends TransitentCommBasePO> T filterModificationType(T t, String modificationType) {
if (null == t || StringUtils.isBlank(modificationType)) {
return null;
} if (modificationType.equalsIgnoreCase(t.getModificationType())) {
return t;
} else {
return null;
}
} public static <T extends TransitentCommBasePO> List<T> filterModificationType(List<T> list, String modificationType) {
if (list == null || list.size() ==0 || StringUtils.isBlank(modificationType)) {
return list;
}
List<T> listWant = new ArrayList<T>();
for (T t : list) {
T t1 = filterModificationType(t, modificationType);
if (t1!=null) {
listWant.add(t1);
}
}
return listWant;
} public static <T extends TransitentCommBasePO> T updateModificationType(T t, String modificationType) {
if (null == t || StringUtils.isBlank(modificationType)) {
return null;
} t.setModificationType(modificationType);
return t;
} public static <T extends TransitentCommBasePO> List<T> updateModificationType(List<T> list, String modificationType) {
if (list == null || list.size() ==0 || StringUtils.isBlank(modificationType)) {
return list;
}
List<T> listWant = new ArrayList<T>();
for (T t : list) {
T t1 = updateModificationType(t, modificationType);
if (t1!=null) {
listWant.add(t1);
}
}
return listWant;
}
}
BeanFilterUtil的更多相关文章
随机推荐
- 堆排序的JavaScript实现
思想 把数组当做二叉树来排序: 索引0是树的根节点: 除根节点外,索引为N的节点的父节点索引是(N-1)/2: 索引为N的节点的左子节点索引是 2*N+1; 索引为N的节点的右子节点索引是 2*N+2 ...
- SQL中replace函数
string sql1 = "select price from dbo.eazy_farm where REPLACE(title,' ','')='" + cainame + ...
- VIJOS:P1706(舞会)
描述 Arthur公司是一个等级森严的公司,它们有着严格的上司与下属的关系,公司以总裁为最高职位,他有若干个下属,他的下属又有若干个下属,他的下属的下属又有若干个下属……现接近年尾,公司组织团拜活动, ...
- unittest ,ddt数据驱动,读取文件中数据,多个参数时的处理
1. test.yaml中的数据 这里的属性是list 2.创建用例 3,在yaml中创建数据,创建list数据,list中再创建dict数据,这样就可以读取dict中的多个参数的数据了
- linux下dns设置详解
DNS就是Domain Name System,它能够把形如www.21php.com这样的域名转换为211.152.50.35这样的IP地址;没有DNS,浏览21php.com这个网站时,就必须用2 ...
- Python-连接Redis并操作
首先开启redis的外连 sch01ar@ubuntu:~$ sudo vim /etc/redis/redis.conf 把bind 127.0.0.1这行注释掉 然后重启redis sudo /e ...
- asp页面重定向
asp页面重定向 1.当你点击某页面时(没有登录),而此页面需要登录,登录后页面需要定向到你之前操作的页面时 就用到了重定向. 2.login.aspx?redirUrl="重定向的页面地址 ...
- 关于cin
今天同学调试一个简单的程序的时候发现了问题,我们两个讨论的时候弄出了好多乐子 #include <iostream> using namespace std; int main() { ; ...
- javaScript之深度理解原型链
经过多次的翻阅书籍终于对原型链在实际代码中的应用有了新的认识,但是不知道是否有错误的地方,还请大神多多指教. 构造函数.原型和实例的关系:每个构造函数都有一个原型对象funName.prototype ...
- JQuery鼠标移动上去显示预览图
body中: <img src="../images/icon_view.gif" bigimg="../img.jpg" title="查看预 ...