|
1 | 1 | packageio.api.etherscan.core.impl; |
2 | 2 |
|
3 | | -importcom.google.gson.Gson; |
| 3 | +importcom.google.gson.*; |
4 | 4 | importio.api.etherscan.error.ApiException; |
5 | 5 | importio.api.etherscan.error.EtherScanException; |
6 | 6 | importio.api.etherscan.error.ParseException; |
|
10 | 10 | importio.api.etherscan.model.utility.StringResponseTO; |
11 | 11 | importio.api.etherscan.util.BasicUtils; |
12 | 12 |
|
| 13 | +importjava.time.LocalDate; |
| 14 | +importjava.time.LocalDateTime; |
13 | 15 | importjava.util.Map; |
14 | 16 |
|
15 | 17 | /** |
@@ -40,7 +42,12 @@ abstract class BasicProvider { |
40 | 42 | this.module ="&module=" +module; |
41 | 43 | this.baseUrl =baseUrl; |
42 | 44 | this.executor =executor; |
43 | | -this.gson =newGson(); |
| 45 | +this.gson =newGsonBuilder() |
| 46 | + .registerTypeAdapter(LocalDateTime.class, (JsonSerializer<LocalDateTime>) (src,t,c) ->newJsonPrimitive("")) |
| 47 | + .registerTypeAdapter(LocalDate.class, (JsonSerializer<LocalDate>) (src,t,context) ->newJsonPrimitive("")) |
| 48 | + .registerTypeAdapter(LocalDateTime.class, (JsonDeserializer<LocalDateTime>) (json,t,c) ->null) |
| 49 | + .registerTypeAdapter(LocalDate.class, (JsonDeserializer<LocalDate>) (json,t,c) ->null) |
| 50 | + .create(); |
44 | 51 | } |
45 | 52 |
|
46 | 53 | <T>Tconvert(finalStringjson,finalClass<T>tClass) { |
|