title: JSON name value pair Parsing in Java
body: <p>I have following JSON structure which i want to parse into Java objects. Are there existing libraries which I can use, or should I write custom code to parse. Sample json structure and java classes are below.</p>
  
  <p>JSON:</p>
  
  <pre><code>"name": "hierarchy",
  "value": "[
    {
      "name": "solutionid",
      "value": "String"
    },
    {
      "name": "groupcode",
      "value": "String"
    },
    {
      "name": "dealhashid",
      "value": "String"
    },
    {
      "name": "keyinfo_customername",
      "value": "String"
    },
    {
      "name": "keyinfo_prequalificationnumber",
      "value": "String"
    },
    {
      "name": "keyinfo_orderactiontype",
      "value": "String"
    }
  ]"
  </code></pre>
  
  <p>Java Object:</p>
  
  <pre><code>class Hierarchy {
      String solutionId;
      String groupCode;
      KeyInfo keyInfo;
  
      public String getSolutionId() {
          return solutionId;
      }
  
      public void setSolutionId(String solutionId) {
          this.solutionId = solutionId;
      }
  
      public String getGroupCode() {
          return groupCode;
      }
  
      public void setGroupCode(String groupCode) {
          this.groupCode = groupCode;
      }
  
      public KeyInfo getKeyInfo() {
          return keyInfo;
      }
  
      public void setKeyInfo(KeyInfo keyInfo) {
          this.keyInfo = keyInfo;
      }
  }
  
  class KeyInfo {
      String customerName;
      String orderActionType;
  
      public String getCustomerName() {
          return customerName;
      }
  
      public void setCustomerName(String customerName) {
          this.customerName = customerName;
      }
  
      public String getOrderActionType() {
          return orderActionType;
      }
  
      public void setOrderActionType(String orderActionType) {
          this.orderActionType = orderActionType;
      }
  }
  </code></pre>