Десериализовать JSON response

получаю некую информацию из апи, ответ приходит в виде JSON (Слишком большой , будет нечитабельно здесь, доступен по ссылке https://app.quicktype.io?share=3Q1ydLTOJI9rgcoUyW6d). Из всего ответа мне необходим только один объект -

"13.0.0": {
      "days": {
        "0": {
          "1380": 1,
          "420": 0
        }
      },
      "seasons": {
        "101": 0
      },
      "weeks": {
        "0": [
          0,
          0,
          0,
          0,
          0,
          0,
          0
        ]
      }
    }

Сделал для него такую модель:

public class Days {
    @SerializedName("days")
    @Expose
    private Map<Integer, Map<Integer,Integer>> days;

    public Days(){
    }
    public Days(Map<Integer, Map<Integer,Integer>> days){
        super();
        this.days = days;
    }
    public Map<Integer, Map<Integer,Integer>> getDays(){
        return this.days;
    }
    public void setDays(Map<Integer, Map<Integer,Integer>> days){
        this.days = days;
    }
    public String toString(){
        return days.toString();
    }

Также два таких же класс для Seasons и Weeks. И общий класс:

public class Tariff {
    @SerializedName("13.0.0")
    @Expose
    private List<Object> tariffList;
    @SerializedName("days")
    @Expose
    private Days days;
    @SerializedName("seasons")
    @Expose
    private Seasons seasons;
    @SerializedName("weeks")
    @Expose
    private Weeks weeks;

    public Tariff(){
    }
    public Tariff(List<Object> tariffList,Days days, Seasons seasons, Weeks weeks){
        super();
        this.tariffList = tariffList;
        this.days = days;
        this.seasons = seasons;
        this.weeks = weeks;
    }
    public List<Object> getTariffList(){
        return this.tariffList;
    }
    public Days getDays(){
        return this.days;
    }
    public Seasons getSeasons(){
        return this.seasons;
    }
    public Weeks getWeeks(){
        return this.weeks;
    }
}

Пытаюсь парсить подобным образом:

    public Tariff parseTariffByModemId(String responseBody){
        JsonObject object = JsonParser.parseString(responseBody).getAsJsonObject().getAsJsonObject("13.0.0");
        return new Gson().fromJson(object, Tariff.class);
    }

Но на выходе получаю NPE и понимаю что ответ маппится неправильно. Где конкретно ошибка не могу понять Заранее спасибо


Ответы (0 шт):