package org.gbif.geocode.api.model;

import java.util.List;
import java.util.Map;

public class GadmRegion {

  private String id;

  private String name;

  private Integer gadmLevel;

  private List<String> variantName;

  private List<String> nonLatinName;

  private List<String> type;

  private List<String> englishType;

  private Map<String, String> higherRegions;

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public Integer getGadmLevel() {
    return gadmLevel;
  }

  public void setGadmLevel(Integer gadmLevel) {
    this.gadmLevel = gadmLevel;
  }

  public List<String> getVariantName() {
    return variantName;
  }

  public void setVariantName(List<String> variantName) {
    this.variantName = variantName;
  }

  public List<String> getNonLatinName() {
    return nonLatinName;
  }

  public void setNonLatinName(List<String> nonLatinName) {
    this.nonLatinName = nonLatinName;
  }

  public List<String> getType() {
    return type;
  }

  public void setType(List<String> type) {
    this.type = type;
  }

  public List<String> getEnglishType() {
    return englishType;
  }

  public void setEnglishType(List<String> englishType) {
    this.englishType = englishType;
  }

  public Map<String, String> getHigherRegions() {
    return higherRegions;
  }

  public void setHigherRegions(Map<String, String> higherRegions) {
    this.higherRegions = higherRegions;
  }
}

@@ -79,34 +79,597 @@
 ap;%0A
-%0Apublic class GadmRegion %7B
+import java.util.stream.Collectors;%0A%0Aimport com.fasterxml.jackson.annotation.JsonIgnore;%0Aimport com.fasterxml.jackson.annotation.JsonProperty;%0A%0Apublic class GadmRegion %7B%0A%0A  public static class Region %7B%0A%0A    private String id;%0A    private String name;%0A%0A    public Region(String id, String name) %7B%0A      this.id = id;%0A      this.name = name;%0A    %7D%0A%0A    public String getId() %7B%0A      return id;%0A    %7D%0A%0A    public void setId(String id) %7B%0A      this.id = id;%0A    %7D%0A%0A    public String getName() %7B%0A      return name;%0A    %7D%0A%0A    public void setName(String name) %7B%0A      this.name = name;%0A    %7D%0A  %7D
 %0A%0A  
@@ -1920,32 +1920,46 @@
 glishType;%0A  %7D%0A%0A
+  @JsonIgnore%0A
   public Map%3CStr
@@ -2134,11 +2134,275 @@
 ons;%0A  %7D
+%0A%0A  @JsonProperty(%22higherRegions%22)%0A  public List%3CRegion%3E getHigherRegionsList() %7B%0A    if(higherRegions != null) %7B%0A      return higherRegions.entrySet().stream().map(e -%3E new Region(e.getKey(), e.getValue())).collect(Collectors.toList());%0A    %7D%0A    return null;%0A  %7D
 %0A%7D%0A

converting higher regions to a list if {id,name}