com.github.cosycode.ext.hub.LogExecuteProxy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of extend-mod Show documentation
Show all versions of extend-mod Show documentation
扩展模块, 用于存放一些非常用的工具或模块的扩展类, 例如在poi基础上扩展的excel的导入模块, 模拟按键模块
The newest version!
package com.github.cosycode.ext.hub;
import lombok.extern.slf4j.Slf4j;
import java.util.Arrays;
import java.util.function.BiFunction;
/**
* Description :
*
* created in 2021/4/6
*
* @author CPF
**/
@Slf4j
public class LogExecuteProxy extends AbstractClosureProxy {
public LogExecuteProxy(T then) {
super(then);
}
public LogExecuteProxy(T then, BiFunction function) {
super(then, function);
}
@Override
public R closureFunction(P params) {
if (params != null) {
if (params.getClass().isArray()) {
log.info(Arrays.toString((Object[]) params));
} else {
log.info(params.toString());
}
} else {
log.info("null");
}
return biFunction.apply(functional, params);
}
}