Convert change to ConvertUtil

This commit is contained in:
Looly
2024-08-23 08:36:52 +08:00
parent c6777244a0
commit 3ddad8ff6c
92 changed files with 336 additions and 339 deletions

View File

@@ -13,7 +13,7 @@
package org.dromara.hutool.json;
import org.dromara.hutool.core.bean.BeanUtil;
import org.dromara.hutool.core.convert.Convert;
import org.dromara.hutool.core.convert.ConvertUtil;
import org.dromara.hutool.core.reflect.TypeReference;
import lombok.Data;
import org.junit.jupiter.api.Assertions;
@@ -31,7 +31,7 @@ public class Issue1101Test {
public void treeMapConvertTest(){
final String json = "[{\"nodeName\":\"admin\",\"treeNodeId\":\"00010001_52c95b83-2083-4138-99fb-e6e21f0c1277\",\"sort\":0,\"type\":10,\"parentId\":\"00010001\",\"children\":[],\"id\":\"52c95b83-2083-4138-99fb-e6e21f0c1277\",\"status\":true},{\"nodeName\":\"test\",\"treeNodeId\":\"00010001_97054a82-f8ff-46a1-b76c-cbacf6d18045\",\"sort\":0,\"type\":10,\"parentId\":\"00010001\",\"children\":[],\"id\":\"97054a82-f8ff-46a1-b76c-cbacf6d18045\",\"status\":true}]";
final JSONArray objects = JSONUtil.parseArray(json);
final TreeSet<TreeNodeDto> convert = Convert.convert(new TypeReference<TreeSet<TreeNodeDto>>() {
final TreeSet<TreeNodeDto> convert = ConvertUtil.convert(new TypeReference<TreeSet<TreeNodeDto>>() {
}, objects);
Assertions.assertEquals(2, convert.size());
}

View File

@@ -12,7 +12,7 @@
package org.dromara.hutool.json;
import org.dromara.hutool.core.convert.Convert;
import org.dromara.hutool.core.convert.ConvertUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.junit.jupiter.api.Assertions;
@@ -82,7 +82,7 @@ public class IssueI49VZBTest {
@Test
public void enumConvertTest(){
final NBCloudKeyType type = Convert.toEnum(NBCloudKeyType.class, "snapKey");
final NBCloudKeyType type = ConvertUtil.toEnum(NBCloudKeyType.class, "snapKey");
Assertions.assertEquals(NBCloudKeyType.snapKey, type);
}
}