src/main/java/org/ednovo/gooru/server/service/PlayerAppServiceImpl.java
/**
	 * Deserializes Content star rating  model object.
	 * 
	 * @param jsonObject {@link JSONObject}
	 * @return starRatingsDo {@link ContentStarRatingsDo}
	 */
Deserializes Content star rating  model object.


Deserializes Content star rating model object .
private ContentStarRatingsDo deserializeContentStarRatings(JSONObject jsonObject) {
		ContentStarRatingsDo contentStarRatingsDo = new  ContentStarRatingsDo(); 
		ContentStarRatingsDistributionDo contentRatingDistribution = new  ContentStarRatingsDistributionDo();
		try {
			contentStarRatingsDo.setAverage(jsonObject.getInt(AVERAGE));
			contentStarRatingsDo.setCount(jsonObject.getInt(COUNT));
			for(int i=1; i<6;i++)
			{
				JSONObject resourceCollectionObject=jsonObject.getJSONObject("scores");
				try
				{
				if(!resourceCollectionObject.isNull(String.valueOf(i)))
				{
				if(i==1)
				{
					contentRatingDistribution.setOne(resourceCollectionObject.getInt(String.valueOf(i)));
				}
				else if(i==2)
				{
					contentRatingDistribution.setTwo(resourceCollectionObject.getInt(String.valueOf(i)));
				}
				else if(i==3)
				{
					contentRatingDistribution.setThree(resourceCollectionObject.getInt(String.valueOf(i)));
				}
				else if(i==4)
				{
					contentRatingDistribution.setFour(resourceCollectionObject.getInt(String.valueOf(i)));
				}
				else if(i==5)
				{
					contentRatingDistribution.setFive(resourceCollectionObject.getInt(String.valueOf(i)));
				}
				}
				else
				{
					if(i==1)
					{
						contentRatingDistribution.setOne(0);
					}
					else if(i==2)
					{
						contentRatingDistribution.setTwo(0);
					}
					else if(i==3)
					{
						contentRatingDistribution.setThree(0);
					}
					else if(i==4)
					{
						contentRatingDistribution.setFour(0);
					}
					else if(i==5)
					{
						contentRatingDistribution.setFive(0);
					}
				}
				}
				catch(Exception ex)
				{
				}
			}
			contentStarRatingsDo.setScores(contentRatingDistribution);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return contentStarRatingsDo;
	}
private ContentStarRatingsDo deserializeContentStarRatings ( JSONObject jsonObject ) { ContentStarRatingsDo contentStarRatingsDo = new ContentStarRatingsDo ( ) ; ContentStarRatingsDistributionDo contentRatingDistribution = new ContentStarRatingsDistributionDo ( ) ; try { contentStarRatingsDo . setAverage ( jsonObject . getInt ( AVERAGE ) ) ; contentStarRatingsDo . setCount ( jsonObject . getInt ( COUNT ) ) ; for ( int i = 1 ; i < 6 ; i ++ ) { JSONObject resourceCollectionObject = jsonObject . getJSONObject ( "scores" ) ; try { if ( ! resourceCollectionObject . isNull ( String . valueOf ( i ) ) ) { if ( i == 1 ) { contentRatingDistribution . setOne ( resourceCollectionObject . getInt ( String . valueOf ( i ) ) ) ; } else if ( i == 2 ) { contentRatingDistribution . setTwo ( resourceCollectionObject . getInt ( String . valueOf ( i ) ) ) ; } else if ( i == 3 ) { contentRatingDistribution . setThree ( resourceCollectionObject . getInt ( String . valueOf ( i ) ) ) ; } else if ( i == 4 ) { contentRatingDistribution . setFour ( resourceCollectionObject . getInt ( String . valueOf ( i ) ) ) ; } else if ( i == 5 ) { contentRatingDistribution . setFive ( resourceCollectionObject . getInt ( String . valueOf ( i ) ) ) ; } } else { if ( i == 1 ) { contentRatingDistribution . setOne ( 0 ) ; } else if ( i == 2 ) { contentRatingDistribution . setTwo ( 0 ) ; } else if ( i == 3 ) { contentRatingDistribution . setThree ( 0 ) ; } else if ( i == 4 ) { contentRatingDistribution . setFour ( 0 ) ; } else if ( i == 5 ) { contentRatingDistribution . setFive ( 0 ) ; } } } catch ( Exception ex ) { } } contentStarRatingsDo . setScores ( contentRatingDistribution ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return contentStarRatingsDo ; }
Deserializes Content star rating  model object.
Deserializes Content star rating model object .
//try end //for end