title: Json object values manipulation in Spring-boot
body: <p>I have a sample json as follows</p>
  
  <pre><code>[{"state":"Completed","mignum":146289,"projectleader":"Eric Lok","productiondate":"Jun 6, 2018","installationtiers":"Windows Server","targetplatform":"Production","apprelated":"UPS Pickup Point Web Application","appversion":"2.25"},
  {"state":"Completed","mignum":146381,"projectleader":"James Rice","productiondate":"Jun 6, 2018","installationtiers":"Linux Web WL10","targetplatform":"Production","apprelated":"Content Only","appversion":""},
  {"state":"Pending Migration to Production","mignum":146461,"projectleader":"Nishith Jani","productiondate":"Jun 6, 2018","installationtiers":"Linux BEA WL12","targetplatform":"Production","apprelated":"Tracking Comp","appversion":"1801.20"},
  {"state":"Completed","mignum":146574,"projectleader":"Nishith Jani","productiondate":"Jun 6, 2018","installationtiers":"Linux BEA WL12","targetplatform":"Production","apprelated":"Tracking Comp","appversion":"01-00-07-17"}
  {"state":Pending Approval by Development in Windward","mignum":146289,"projectleader":"Eric Lok","productiondate":"Jun 6, 2018","installationtiers":"Windows Server","targetplatform":"Production","apprelated":"UPS Pickup Point Web Application","appversion":"2.25"},
  {"state":"Completed","mignum":146381,"projectleader":"James Rice","productiondate":"Jun 6, 2018","installationtiers":"Linux Web WL10","targetplatform":"Production","apprelated":"Content Only","appversion":""},
  {"state":"Pending Approval by Development in Windward","mignum":146461,"projectleader":"Nishith Jani","productiondate":"Jun 6, 2018","installationtiers":"Linux BEA WL12","targetplatform":"Production","apprelated":"Tracking Comp","appversion":"1801.20"},
  {"state":"Pending Migration to Production","mignum":146574,"projectleader":"Nishith Jani","productiondate":"Jun 6, 2018","installationtiers":"Linux BEA WL12","targetplatform":"Production","apprelated":"Tracking Comp","appversion":"01-00-07-17"}
  ]
  </code></pre>
  
  <p>which I obtained from db using jdbc connection in Spring</p>
  
  <pre><code>@GetMapping("/dashboard")
  public String Data() {
      Connection conn = null;
      List&lt;Map&lt;String, Object&gt;&gt; listOfDates = null;
      try {
          Class.forName("com.mysql.jdbc.Driver");
          conn = DriverManager.getConnection(DB_URL, USER, PASS);
          String countQuery = "SELECT migrations.mignum, migration_states.statemigrations.projectleader, migrations.productiondate, migrations.installationtiers, migrations.targetplatform, migrations.apprelated, migrations.appversion FROM migrations, migration_states WHERE migrations.productiondate='2018-07-07";
          QueryRunner queryRunner = new QueryRunner();
          listOfDates = queryRunner.query(conn, countQuery, new MapListHandler());
          conn.close();
      } catch (SQLException se) {
          se.printStackTrace();
      } catch (Exception e) {
          e.printStackTrace();
      } finally {
          DbUtils.closeQuietly(conn);
      }
      return new Gson().toJson(listOfDates);
  }
  </code></pre>
  
  <p>I want to parse result and save it in another json as follows
   1. 1st result  </p>
  
  <pre><code>[
  {
  "state":"Completed"
  "value": [
      {"mignum":146289,"projectleader":"Eric Lok","productiondate":"Jun 6, 2018","installationtiers":"Windows Server","targetplatform":"Production","apprelated":"UPS Pickup Point Web Application","appversion":"2.25"};
      {"mignum":146381,"projectleader":"James Rice","productiondate":"Jun 6, 2018","installationtiers":"Linux Web WL10","targetplatform":"Production","apprelated":"Content Only","appversion":""},
      {"mignum":146381,"projectleader":"James Rice","productiondate":"Jun 6, 2018","installationtiers":"Linux Web WL10","targetplatform":"Production","apprelated":"Content Only","appversion":""}
  ]
  }
  {
  "state":"Pending Migration to Production"
  "value": [
      {"mignum":146461,"projectleader":"Nishith Jani","productiondate":"Jun 6, 2018","installationtiers":"Linux BEA WL12","targetplatform":"Production","apprelated":"Tracking Comp","appversion":"1801.20"}.
      {"mignum":146574,"projectleader":"Nishith Jani","productiondate":"Jun 6, 2018","installationtiers":"Linux BEA WL12","targetplatform":"Production","apprelated":"Trackin Comp","appversion":"01-00-07-17"}
  ]
  }
  {
  "state":"Pending Approval by Development in Windward"
  "value": [
      {"mignum":146461,"projectleader":"Nishith Jani","productiondate":"Jun 6, 2018","installationtiers":"Linux BEA WL12","targetplatform":"Production","apprelated":"Tracking Comp","appversion":"1801.20"}.
      {"mignum":146574,"projectleader":"Nishith Jani","productiondate":"Jun 6, 2018","installationtiers":"Linux BEA WL12","targetplatform":"Production","apprelated":"Trackin Comp","appversion":"01-00-07-17"}
  ]
  }
  ]
  </code></pre>
  
  <p>2. 2nd result</p>
  
  <pre><code>[
    { "state":"Completed", "count": "2"},
    { "state":"Pending Migration to Production", "count": "2"},
    { "state":"Pending Approval by Development in Windward", "count": "2"}
  ]
  </code></pre>
  
  <p>I'm new to this json manipulation in Java/Spring side, so any one help me,because I'm stuck at this point from long time</p>