ConvertColumnTransfer优化

This commit is contained in:
redkale
2024-06-04 12:14:37 +08:00
parent 897eb97d46
commit 3819e42593
3 changed files with 4 additions and 7 deletions

View File

@@ -4,8 +4,6 @@
package org.redkale.convert;
import org.redkale.util.Attribute;
/**
* 字段值转换器,常见于脱敏操作
*
@@ -22,10 +20,10 @@ public interface ConvertColumnTransfer<F> {
* 字段值转换
*
* @param obj 父对象
* @param attribute 属性对象
* @param field 字段名
* @param value 字段值
*
* @return Object
*/
public Object transfer(Object obj, Attribute attribute, F value);
public Object transfer(Object obj, String field, F value);
}

View File

@@ -107,7 +107,7 @@ public final class EnMember<W extends Writer, T, F> {
public Object getFieldValue(T obj) {
F val = attribute.get(obj);
if (transfer != null) {
return transfer.transfer(obj, attribute, val);
return transfer.transfer(obj, attribute.field(), val);
} else {
return val;
}