Code example for JsonParser

Methods: parse

0
	} 
	 
	 
	private String makePretty(String uglyJSONString) {
		Gson gson = new GsonBuilder().setPrettyPrinting().create();
		JsonParser jp = new JsonParser();
		JsonElement je = jp.parse(uglyJSONString);
		String prettyJsonString = gson.toJson(je);
		return prettyJsonString;
	} 
	 
	public static class CandidateList { 
		private int id;
		private String name;
		private int nVotes;
		private float percent;
		 
		public CandidateList(int id,String name,int nVotes,float percent){
			this.id=id;
			this.name=name;
Experience pair programming with AI  Get Codota for Java