增加LambdaBiConsumer
This commit is contained in:
31
src/main/java/org/redkale/util/LambdaBiConsumer.java
Normal file
31
src/main/java/org/redkale/util/LambdaBiConsumer.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package org.redkale.util;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
/**
|
||||
* Lambda的BiConsumer自定义类
|
||||
*
|
||||
* <p>
|
||||
* 详情见: https://redkale.org
|
||||
*
|
||||
* @author zhangjx
|
||||
* @since 2.8.0
|
||||
*
|
||||
* @param <T> 泛型
|
||||
* @param <R> 泛型
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface LambdaBiConsumer<T, R> extends BiConsumer<T, R>, Serializable {
|
||||
|
||||
public static <T> String readColumn(LambdaBiConsumer<T, ?> consumer) {
|
||||
return Utility.readFieldName(consumer);
|
||||
}
|
||||
|
||||
public static <T> Class<T> readClass(LambdaBiConsumer<T, ?> consumer) {
|
||||
return Utility.readClassName(consumer);
|
||||
}
|
||||
}
|
||||
@@ -276,6 +276,14 @@ public final class Utility {
|
||||
return readLambdaFieldName(func);
|
||||
}
|
||||
|
||||
public static String readFieldName(LambdaBiConsumer consumer) {
|
||||
return readLambdaFieldName(consumer);
|
||||
}
|
||||
|
||||
public static Class readClassName(LambdaBiConsumer consumer) {
|
||||
return readLambdaClassName(consumer);
|
||||
}
|
||||
|
||||
public static String readFieldName(LambdaSupplier func) {
|
||||
return readLambdaFieldName(func);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user