This commit is contained in:
YuTian 2024-07-17 16:08:21 +08:00
parent cb58d3c7e6
commit 66e6a90a81
2 changed files with 6 additions and 4 deletions

View File

@ -64,7 +64,7 @@ public class SerializeHelper {
continue; continue;
} }
Object deserializeValue = deserializeValue(field, field.getType(), value); Object deserializeValue = deserializeValue(field, field.getType(), value);
field.set(instance, deserializeValue); ReflectionUtil.setFieldUsingUnsafe(field, instance, deserializeValue);
} }
return instance; return instance;
} catch (Exception e) { } catch (Exception e) {
@ -116,8 +116,9 @@ public class SerializeHelper {
map.put(key, deserializeValue(field, valueType, jsonObject.get(key))); map.put(key, deserializeValue(field, valueType, jsonObject.get(key)));
} }
return map; return map;
} else {
return deserialize(clazz, (JSONObject) value);
} }
return null;
} }
private static Object serializeValue(Object value) throws SerializeException { private static Object serializeValue(Object value) throws SerializeException {
@ -159,8 +160,9 @@ public class SerializeHelper {
jsonObject.put(key.toString(), serializeValue(map.get(key))); jsonObject.put(key.toString(), serializeValue(map.get(key)));
} }
return jsonObject; return jsonObject;
} else {
return serialize(value);
} }
return null;
} }
public static final Map<Class<?>, Class<?>> WRAPPER_TO_PRIMITIVE = new HashMap<>(); public static final Map<Class<?>, Class<?>> WRAPPER_TO_PRIMITIVE = new HashMap<>();

View File

@ -1,4 +1,4 @@
name: AuLib name: AuLib
main: com.io.yutian.aulib.AuLib main: com.io.yutian.aulib.AuLib
version: 1.3.2 version: 1.3.4
author: SuperYuTian author: SuperYuTian