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的更多相关文章

随机推荐

  1. 【LeetCode】020. Valid Parentheses

    Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the inpu ...

  2. backbonejs学习

    文章: http://www.cnblogs.com/yexiaochai/archive/2013/07/27/3219402.html http://blog.csdn.net/cony100/a ...

  3. 洛谷【P1561】[USACO12JAN]爬山Mountain Climbing

    我对\(Jhonson\)算法的理解:https://www.cnblogs.com/AKMer/p/9863620.html 题目传送门:https://www.luogu.org/problemn ...

  4. iPhone白苹果怎么办?白苹果各种解决办法方法

    iPhone白苹果怎么办?白苹果各种解决办法方法 日期:2014-07-16 来源:爱思助手 浏览次数:60962 越狱后大家也疯狂的装入各种插件,由于一些插件会产生冲突,造成白苹果现象,无法进入手机 ...

  5. from selenium.webdriver.support.ui import Select

    from selenium.webdriver.support.ui import Select Select(d.find_element_by_id(u'key_开户行')).first_sele ...

  6. web攻击之六:DNS攻击原理与防范

    随着网络的逐步普及,网络安全已成为INTERNET路上事实上的焦点,它关系着INTERNET的进一步发展和普及,甚至关系着INTERNET的生存.可喜的是我们那些互联网专家们并没有令广大INTERNE ...

  7. JAVA 1.5 并发之 Executor框架 (内容为转载)

    本文内容转自 http://www.iteye.com/topic/366591 Executor框架是指java 5中引入的一系列并发库中与executor相关的一些功能类,其中包括线程池,Exec ...

  8. JSP标签和EL表达式

    1.jsp标签: sun原生的,直接jsp使用 <jsp:include> -- 实现页面包含,动态包含 <jsp:include page="/index.jsp&quo ...

  9. play 学习 一 : 构建SBT的play项目

    因为帮一个朋友做一个简单的项目,档案管理.同时也为了自己能学习PLay框架,所以记录一下. 项目GitHub地址: https://github.com/liufeiSAP/ArchiveManage ...

  10. NW.js将网站打包成桌面应用

    需求:已有一个网站,因为浏览器兼容性等问题,想自己封装一个浏览器,打开时固定打开这个网站,通过这样的封装,将网站变成桌面应用程序. 1. 下载并安装NW.js的最新稳定版本(NW.js) 2. 创建一 ...