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


Deserializes Star rating model object .
private StarRatingsDo deserializeResourceStarRatings(JSONObject jsonObject) {
		StarRatingsDo starRatingsDo = new  StarRatingsDo(); 
		try {
			starRatingsDo.setAssocGooruOid(jsonObject.isNull("assocGooruOid")?"":jsonObject.getString("assocGooruOid"));
			starRatingsDo.setDeleteRatingGooruOid(jsonObject.isNull("gooruOid")?"":jsonObject.getString("gooruOid"));
			if(!jsonObject.isNull("ratings")){
				JSONObject resourceRating = jsonObject.getJSONObject("ratings");
				SearchRatingsDo searchRatingsDo =JsonDeserializer.deserialize(resourceRating.toString(), SearchRatingsDo.class);
				starRatingsDo.setRatings(searchRatingsDo);
			}
			if(!jsonObject.isNull("creator"))
			{
				CreatorDo creatorObject = new CreatorDo();
				JSONObject jsonCreatorObject = new JSONObject();
				jsonCreatorObject = jsonObject.getJSONObject("creator");
				creatorObject.setUsername(jsonCreatorObject.isNull("username")?"":jsonCreatorObject.getString("username"));
				creatorObject.setFirstName(jsonCreatorObject.isNull("firstName")?"":jsonCreatorObject.getString("firstName"));
				creatorObject.setLastName(jsonCreatorObject.isNull("lastName")?"":jsonCreatorObject.getString("lastName"));
				creatorObject.setGooruUId(jsonCreatorObject.isNull("gooruUId")?"":jsonCreatorObject.getString("gooruUId"));
				starRatingsDo.setCreator(creatorObject);
			}
			starRatingsDo.setScore(jsonObject.getInt(SCORE));
			starRatingsDo.setCreatedDate(jsonObject.getLong(CREATE_DATE));
			starRatingsDo.setLastModifiedOn(jsonObject.isNull(LAST_MODIFIED_ON) ? 0 : jsonObject.getLong(LAST_MODIFIED_ON));
			starRatingsDo.setFreeText(jsonObject.isNull("freeText")?"":jsonObject.getString("freeText"));
		} catch (Exception e) {
			e.printStackTrace();
		}
		return starRatingsDo;
	}
private StarRatingsDo deserializeResourceStarRatings ( JSONObject jsonObject ) { StarRatingsDo starRatingsDo = new StarRatingsDo ( ) ; try { starRatingsDo . setAssocGooruOid ( jsonObject . isNull ( "assocGooruOid" ) ? "" : jsonObject . getString ( "assocGooruOid" ) ) ; starRatingsDo . setDeleteRatingGooruOid ( jsonObject . isNull ( "gooruOid" ) ? "" : jsonObject . getString ( "gooruOid" ) ) ; if ( ! jsonObject . isNull ( "ratings" ) ) { JSONObject resourceRating = jsonObject . getJSONObject ( "ratings" ) ; SearchRatingsDo searchRatingsDo = JsonDeserializer . deserialize ( resourceRating . toString ( ) , SearchRatingsDo . class ) ; starRatingsDo . setRatings ( searchRatingsDo ) ; } if ( ! jsonObject . isNull ( "creator" ) ) { CreatorDo creatorObject = new CreatorDo ( ) ; JSONObject jsonCreatorObject = new JSONObject ( ) ; jsonCreatorObject = jsonObject . getJSONObject ( "creator" ) ; creatorObject . setUsername ( jsonCreatorObject . isNull ( "username" ) ? "" : jsonCreatorObject . getString ( "username" ) ) ; creatorObject . setFirstName ( jsonCreatorObject . isNull ( "firstName" ) ? "" : jsonCreatorObject . getString ( "firstName" ) ) ; creatorObject . setLastName ( jsonCreatorObject . isNull ( "lastName" ) ? "" : jsonCreatorObject . getString ( "lastName" ) ) ; creatorObject . setGooruUId ( jsonCreatorObject . isNull ( "gooruUId" ) ? "" : jsonCreatorObject . getString ( "gooruUId" ) ) ; starRatingsDo . setCreator ( creatorObject ) ; } starRatingsDo . setScore ( jsonObject . getInt ( SCORE ) ) ; starRatingsDo . setCreatedDate ( jsonObject . getLong ( CREATE_DATE ) ) ; starRatingsDo . setLastModifiedOn ( jsonObject . isNull ( LAST_MODIFIED_ON ) ? 0 : jsonObject . getLong ( LAST_MODIFIED_ON ) ) ; starRatingsDo . setFreeText ( jsonObject . isNull ( "freeText" ) ? "" : jsonObject . getString ( "freeText" ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return starRatingsDo ; }
Deserializes  Star rating model object.
Deserializes Star rating model object .