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. mysqllog

    -- mysql delete log online 1  mysql命令purge mysql> purge master logs to "mysql-bin.000410&quo ...

  2. POJ3468(线段树区间维护)

    A Simple Problem with Integers Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 85502   ...

  3. 《Kubernetes权威指南第2版》学习(三)RC学习

    1 RC文件介绍: kind: ReplicationController,表示是一个RC: spec.selector:  RC的Pod标签(Label)选择器,监控和管理拥有这些标签的Pod实例, ...

  4. uboot的relocation原理详细分析

    转自:http://blog.csdn.net/skyflying2012/article/details/37660265 最近在一直在做uboot的移植工作,uboot中有很多值得学习的东西,之前 ...

  5. mariadb的读写分离

    实验环境:CentOS7 设备:一台主数据库服务器,两台从数据库服务器,一台调度器 主从的数据库配置请查阅:http://www.cnblogs.com/wzhuo/p/7171757.html : ...

  6. oracle--循环PL/SQL--demo1---

    --简单的条件判断if–then --编写一个过程,可以输入一个雇员名,如果该雇员的工资低于2000,就给该员工工资增加10%. create or replace procedure sp_pro6 ...

  7. 忘记mysql密码,但是可以用navicat修改MySQL密码

    1.首先:要知道你的账户 2.打开可以连接的navicat,在查询语句页面,输入以下操作,就可以修改成功密码了

  8. PID控制及整定算法

    一.PID控制算法 PID是比例.积分.微分的简称,PID控制的难点不是编程,而是控制器的参数整定.参数整定的关键是正确地理解各参数的物理意义,PID 控制的原理可以用人对炉温的手动控制来理解.阅读本 ...

  9. C#设计模式(11)——外观模式

    一.概念 外观模式提供了一个统一的接口,用来访问子系统中的一群接口.外观定义了一个高层接口,让子系统更容易使用.使用外观模式时,我们创建了一个统一的类,用来包装子系统中一个或多个复杂的类,客户端可以直 ...

  10. C笔试题(二)

    /* 现在有一个数组 我们可以定义数组的子数组 如 数组 1 3 4 2 5 8 7 它的子数组可以是 1 3 4 3 4 2 5 等等 请写一个算法 找一个子数组 这个子数组递增不减少 并且是满足递 ...