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. mysql绿色安装

    先下载需要的文件: MySQL5.1(绿色).rar 和 MySQL-Front_v5.3(绿色版).rar 都是绿色免安装版 1.解压MySQL Server 5.1.rar到MySQL Serve ...

  2. vmware station中 UDEV 无法获取共享存储磁盘的UUID,症状: scsi_id -g -u -d /dev/sdb 无返回结果。

    1.确认在所有RAC节点上已经安装了必要的UDEV包 [root@11gnode1 ~]# rpm -qa|grep udevsystem-config-printer-udev-1.1.16-25. ...

  3. 51nod 1967 路径定向——欧拉回路

    题目:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1967 一共只会有偶数个奇数度的点.因为每多一条边,总度数加2. 把 ...

  4. Python:urllib模块的urlretrieve方法

    转于:https://blog.csdn.net/fengzhizi76506/article/details/59229846 博主:fengzhizi76506 1)功能: urllib模块提供的 ...

  5. 对spring、AOP、IOP的理解 (转)

    spring 的优点?1.降低了组件之间的耦合性 ,实现了软件各层之间的解耦2.可以使用容易提供的众多服务,如事务管理,消息服务等3.容器提供单例模式支持4.容器提供了AOP技术,利用它很容易实现如权 ...

  6. Centos开启telnet/ssh/ftp/sftp服务

    Telnet 开启telnet服务步骤: 1.   查看CentOS/Telnet_server版本:#cat /etc/issue,   #rpm -qa | grep telnet 2.   安装 ...

  7. 关于C/C++中的“auto”关键字

    C/C++ 98标准 C++03标准 早在C++98标准中就存在了auto关键字,那时的auto用于声明变量为自动变量,自动变量意为拥有自动的生命期.此用法是多余的,因为即使定义变量时不加" ...

  8. 1.3 DVWA亲测sql注入漏洞

    LOW等级   我们先输入1 我们加上一个单引号,页面报错 我们看一下源代码: <?php if( isset( $_REQUEST[ 'Submit' ] ) ) { // Get input ...

  9. HTML5与CSS3实例教程(第2版) 附源码 中文pdf扫描版

    HTML5和CSS3技术是目前整个网页的基础.<HTML5与CSS3实例教程(第2版)>共分3部分,集中讨论了HTML5和CSS3规范及其技术的使用方法.这一版全面讲解了最新的HTML5和 ...

  10. 从CGI到FastCGI到PHP-FPM

    从CGI到FastCGI到PHP-FPM 背景 笔者在学习这几个名词的时候,也是被百度到的相关文章迷惑.涉及到的主要名词包括 1. CGI协议 2. CGI脚本 3. PHP-CGI 4. FastC ...