Skip to content

Commit

Permalink
gson util
Browse files Browse the repository at this point in the history
  • Loading branch information
leaderli committed Mar 4, 2024
1 parent a72d0e9 commit 8d8eec4
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
*/
public class GsonUtil {

public static final Gson GSON = new GsonBuilder()
.registerTypeAdapterFactory(new SpecailMapValueTypeAdapterFactory())
public static final Gson GSON = new GsonBuilder().registerTypeAdapterFactory(new SpecailMapValueTypeAdapterFactory())
// .setPrettyPrinting()
.create();
private static final Type SPECIAL_MAP_TYPE = ParameterizedTypeImpl.make(null, Map.class, String.class, SpecialMapValue.class);
public static final Type SPECIAL_MAP_TYPE = ParameterizedTypeImpl.make(null, Map.class, String.class, SpecialMapValue.class);

public static String toJson(Object obj) {
return GSON.toJson(obj);
Expand Down

0 comments on commit 8d8eec4

Please sign in to comment.