提交 1a789d25 编写于 作者: 如梦技术's avatar 如梦技术 🐛

📝 记录 问题

上级 40db10f0
...@@ -46,6 +46,13 @@ ...@@ -46,6 +46,13 @@
## 文档 ## 文档
文档编写中,敬请期待... 文档编写中,敬请期待...
## 已知问题
lombok 生成的 method 问题:https://github.com/rzwitserloot/lombok/issues/1861
对于 xX 类属性名,第一个小写,第二个大写的 bean 属性名,Map -> Bean 或 Bean -> Map 存在问题。
不打算做兼容,待 lombok 新版修复。
## 协议 ## 协议
![LGPL v3](docs/img/lgplv3-147x51.png) ![LGPL v3](docs/img/lgplv3-147x51.png)
......
...@@ -27,9 +27,17 @@ public class MapToBeanTest { ...@@ -27,9 +27,17 @@ public class MapToBeanTest {
map.put("six", "女"); map.put("six", "女");
map.put("gender", "男"); map.put("gender", "男");
map.put("xx", "xx"); map.put("xx", "xx");
map.put("xInt", 100);
map.put("xxInt", 101);
map.put("xLong", 10000L);
User1 user1 = BeanUtil.copy(map, User1.class); User1 user1 = BeanUtil.copy(map, User1.class);
System.out.println(user1); System.out.println(user1);
System.out.println(BeanUtil.toMap(user1));
User1 userx = new User1();
BeanUtil.copy(user1, userx);
System.out.println(userx);
User1 user2 = BeanUtil.copyWithConvert(map, User1.class); User1 user2 = BeanUtil.copyWithConvert(map, User1.class);
System.out.println(user2); System.out.println(user2);
...@@ -39,5 +47,8 @@ public class MapToBeanTest { ...@@ -39,5 +47,8 @@ public class MapToBeanTest {
User user4 = BeanUtil.copyWithConvert(map, User.class); User user4 = BeanUtil.copyWithConvert(map, User.class);
System.out.println(user4); System.out.println(user4);
User user5 = BeanUtil.copy(user2, User.class);
System.out.println(user5);
} }
} }
package net.dreamlu.mica.test.utils; package net.dreamlu.mica.test.utils;
import lombok.Data; import lombok.Data;
import lombok.ToString;
import net.dreamlu.mica.core.beans.CopyProperty; import net.dreamlu.mica.core.beans.CopyProperty;
@Data @Data
...@@ -11,4 +12,7 @@ public class User { ...@@ -11,4 +12,7 @@ public class User {
private String xx; private String xx;
@CopyProperty("six") @CopyProperty("six")
private String gender; private String gender;
private int xInt;
private int xxInt;
private long xLong;
} }
...@@ -18,4 +18,7 @@ public class User1 { ...@@ -18,4 +18,7 @@ public class User1 {
@CopyProperty(ignore = true) @CopyProperty(ignore = true)
private Integer xx; private Integer xx;
private List<String> data; private List<String> data;
private int xInt;
private Integer xxInt;
private long xLong;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册