File was renamed from HDLSDK/hdl-common/src/main/java/com/hdl/sdk/common/utils/gson/GsonConvert.java |
| | |
| | | package com.hdl.sdk.common.utils.gson;
|
| | | package com.hdl.sdk.link.common.utils.gson;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | |
| | | return gson;
|
| | | }
|
| | |
|
| | | public static <T> T copyProperties(Object o, Type type) {
|
| | | return getGson().fromJson(getGson().toJson(o), type);
|
| | | }
|
| | |
|
| | | private static class StringTypeAdapter implements JsonSerializer<String>, JsonDeserializer<String> {
|
| | | @Override
|
| | | public String deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
|