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的更多相关文章
随机推荐
- Fortify代码扫描解决方案
Fortify扫描漏洞解决方案: Log Forging漏洞: 1.数据从一个不可信赖的数据源进入应用程序. 在这种情况下,数据经由getParameter()到后台. 2. 数据写入到应用程序或系统 ...
- .NET接入微信支付(一)JS API接入 V3
前段时间刚接完银联支付,完事后又接了微信支付,前段时间一直急着上线,微信的接入一直没有时间处理,今天我们就来整理一下微信支付的接入方法和要点. 配置: 首先呢微信支付需要通过审核,审核啥的准备工作我就 ...
- C#某月的第一天和最后一天
1.本月的第一天===>DateTime.Now.AddDays(1 - DateTime.Now.Day);//当前日期减去当前日期和本月一号相差天数 2.本月的最后一天===>Date ...
- 【转】Pro Android学习笔记(十五):用户界面和控制(3):Button控件
目录(?)[-] 基础Button ImageButton ToggleButton CheckBox RadioButton 基础Button Button是最常用的基础控件之一,在Android中 ...
- EventLoop 与 Channel 的关联
Netty 中, 每个 Channel 都有且仅有一个 EventLoop 与之关联, 它们的关联过程如下: 从上图中我们可以看到, 当调用了 AbstractChannel#AbstractUnsa ...
- ES6学习之Class
一.定义类(ES6的类,完全可以看做是构造函数的另一种写法) class Greet { constructor(x, y) { this.x = x; this.y = y; } sayHello( ...
- python 基础 列表 小例子
存主机ip到列表 host_list=[] netip='192.168.1' for hostip in range(1,254): ip = netip +str(hostip) host_lis ...
- python-queue知识点
1.dict获取value dict.get(key_name)2.三元运算 res,err=stdout.read(),stderr.read() #三元运算 result=res if res e ...
- ubuntu安装配置ApachePhpMysql
1.安装之前先sudo源 sudo apt update 2.安装Apache2 sudo apt install apache2 3.更改默认目录: vi /etc/apache2/apache2. ...
- Koa1 框架
安装创建项目: 1.一定要全局安装(koa1.2和koa2都己经支持) npm install koa-generator -g 2.koa1 生成一个test项目,切到test目录并下载依赖 koa ...