mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
Mapproxy support set return this
This commit is contained in:
parent
217ac3f708
commit
c0fdd353cd
@ -3,9 +3,11 @@
|
|||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
# 5.7.8 (2021-08-02)
|
# 5.7.8 (2021-08-06)
|
||||||
|
|
||||||
### 🐣新特性
|
### 🐣新特性
|
||||||
|
* 【core 】 MapProxy支持return this的setter方法(pr#392@Gitee)
|
||||||
|
|
||||||
### 🐞Bug修复
|
### 🐞Bug修复
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -155,8 +155,11 @@ public class MapProxy implements Map<Object, Object>, OptNullBasicTypeFromObject
|
|||||||
final String fieldName = StrUtil.removePreAndLowerFirst(methodName, 3);
|
final String fieldName = StrUtil.removePreAndLowerFirst(methodName, 3);
|
||||||
if (StrUtil.isNotBlank(fieldName)) {
|
if (StrUtil.isNotBlank(fieldName)) {
|
||||||
this.put(fieldName, args[0]);
|
this.put(fieldName, args[0]);
|
||||||
|
final Class<?> returnType = method.getReturnType();
|
||||||
|
if(returnType.isInstance(proxy)){
|
||||||
return proxy;
|
return proxy;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if ("equals".equals(methodName)) {
|
} else if ("equals".equals(methodName)) {
|
||||||
return this.equals(args[0]);
|
return this.equals(args[0]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user