src/main/java/org/ednovo/gooru/server/service/PlayerAppServiceImpl.java
/**
	 * De-Serialize Resource ratings with reviews.
	 * @param jsonObject {@link JSONObject}
	 * @return {@link  ArrayList<StarRatingsDo> }
	 */
De-Serialize Resource ratings with reviews.
De - Serialize Resource ratings with reviews .
private ArrayList<StarRatingsDo> deserializeGetResourceRatingWithReviews(JSONObject jsonObject) {
		ArrayList<StarRatingsDo> starRatingsList=new ArrayList<StarRatingsDo>();
		try {
			if(jsonObject.getInt("totalHitCount")>0){
				JSONArray jsonArray=jsonObject.getJSONArray("searchResults"); 
				for(int i=0;i<jsonArray.length();i++){
					JSONObject resourceRatingsJsonObject=jsonArray.getJSONObject(i);
					StarRatingsDo starRatingsDo =deserializeResourceStarRatings(resourceRatingsJsonObject);
					starRatingsDo.setTotalHitCount(jsonObject.getInt("totalHitCount"));
					starRatingsList.add(starRatingsDo);
				}	
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return starRatingsList;
	}
private ArrayList < StarRatingsDo > deserializeGetResourceRatingWithReviews ( JSONObject jsonObject ) { ArrayList < StarRatingsDo > starRatingsList = new ArrayList < StarRatingsDo > ( ) ; try { if ( jsonObject . getInt ( "totalHitCount" ) > 0 ) { JSONArray jsonArray = jsonObject . getJSONArray ( "searchResults" ) ; for ( int i = 0 ; i < jsonArray . length ( ) ; i ++ ) { JSONObject resourceRatingsJsonObject = jsonArray . getJSONObject ( i ) ; StarRatingsDo starRatingsDo = deserializeResourceStarRatings ( resourceRatingsJsonObject ) ; starRatingsDo . setTotalHitCount ( jsonObject . getInt ( "totalHitCount" ) ) ; starRatingsList . add ( starRatingsDo ) ; } } } catch ( Exception e ) { e . printStackTrace ( ) ; } return starRatingsList ; }
De-Serialize Resource ratings with reviews.
De - Serialize Resource ratings with reviews .