mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add CellBorderStyle
This commit is contained in:
@@ -29,6 +29,7 @@ import java.io.Serializable;
|
||||
import java.lang.reflect.Array;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@@ -332,14 +333,27 @@ public class ObjUtil {
|
||||
/**
|
||||
* 如果指定的对象不为 {@code null},则应用提供的映射函数并返回结果,否则返回 {@code null}。
|
||||
*
|
||||
* @param source 要检查的对象
|
||||
* @param source 要检查的对象
|
||||
* @param handler 要应用的映射函数
|
||||
* @param <T> 输入对象的类型
|
||||
* @param <R> 映射函数的返回类型
|
||||
* @param <T> 输入对象的类型
|
||||
* @param <R> 映射函数的返回类型
|
||||
* @return 映射函数的结果, 如果输入对象为 null,则返回 null
|
||||
*/
|
||||
public static <T, R> R apply(final T source, final Function<T, R> handler) {
|
||||
return defaultIfNull(source, handler, (R)null);
|
||||
return defaultIfNull(source, handler, (R) null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果指定的对象不为 {@code null},则执行{@link Consumer}处理source,否则不进行操作
|
||||
*
|
||||
* @param source 要检查的对象
|
||||
* @param consumer source处理逻辑
|
||||
* @param <T> 输入对象的类型
|
||||
*/
|
||||
public static <T> void accept(final T source, final Consumer<T> consumer) {
|
||||
if (null != source) {
|
||||
consumer.accept(source);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user