sdk/src/com/socialize/entity/PropagationFactory.java
@Override
	protected void toJSON(Propagation from, JSONObject to) throws JSONException {
		
		// Make params
		Map<String, String> extraParams = from.getExtraParams();
		
		if(extraParams != null && extraParams.size() > 0) {
			
			Set<Entry<String, String>> entrySet = extraParams.entrySet();
			
			if(entrySet != null && entrySet.size() > 0) {
				
				int count = 0;

				StringBuilder builder = new StringBuilder();
				
				for (Entry<String, String> entry : entrySet) {
					
					String key = entry.getKey();
					String value = entry.getValue();
					
					if(!StringUtils.isEmpty(key) && !StringUtils.isEmpty(value)) {
						if(count > 0) {
							builder.append("&");
						}			
						
						builder.append(URLEncoder.encode(key));
						builder.append("=");
						builder.append(URLEncoder.encode(value));
						
						count++;
					}
				}
				
				to.put("extra_params", builder.toString());
			}
		}
		
		JSONArray networks = new JSONArray();
		
		List<ShareType> thirdParties = from.getThirdParties();
		
		if(thirdParties != null && thirdParties.size() > 0) {
			for (ShareType socialNetwork : thirdParties) {
				networks.put(socialNetwork.name().toLowerCase());
			}
			to.put("third_parties", networks);
		}
	}
@Override
	protected void toJSON(Propagation from, JSONObject to) throws JSONException {
		
		// Make params
		Map<String, String> extraParams = from.getExtraParams();
		
		if(extraParams != null && extraParams.size() > 0) {
			
			Set<Entry<String, String>> entrySet = extraParams.entrySet();
			
			if(entrySet != null && entrySet.size() > 0) {
				
				int count = 0;

				StringBuilder builder = new StringBuilder();
				
				for (Entry<String, String> entry : entrySet) {
					
					String key = entry.getKey();
					String value = entry.getValue();
					
					if(!StringUtils.isEmpty(key) && !StringUtils.isEmpty(value)) {
						if(count > 0) {
							builder.append("&");
						}			
						
						builder.append(URLEncoder.encode(key));
						builder.append("=");
						builder.append(URLEncoder.encode(value));
						
						count++;
					}
				}
				
				to.put("extra_params", builder.toString());
			}
		}
		
		JSONArray networks = new JSONArray();
		
		List<ShareType> thirdParties = from.getThirdParties();
		
		if(thirdParties != null && thirdParties.size() > 0) {
			for (ShareType socialNetwork : thirdParties) {
				networks.put(socialNetwork.name().toLowerCase());
			}
			to.put("third_parties", networks);
		}
	}
@ Override protected void toJSON ( Propagation from , JSONObject to ) throws JSONException { // Make params Map < String , String > extraParams = from . getExtraParams ( ) ; if ( extraParams != null && extraParams . size ( ) > 0 ) { Set < Entry < String , String > > entrySet = extraParams . entrySet ( ) ; if ( entrySet != null && entrySet . size ( ) > 0 ) { int count = 0 ; StringBuilder builder = new StringBuilder ( ) ; for ( Entry < String , String > entry : entrySet ) { String key = entry . getKey ( ) ; String value = entry . getValue ( ) ; if ( ! StringUtils . isEmpty ( key ) && ! StringUtils . isEmpty ( value ) ) { if ( count > 0 ) { builder . append ( "&" ) ; } builder . append ( URLEncoder . encode ( key ) ) ; builder . append ( "=" ) ; builder . append ( URLEncoder . encode ( value ) ) ; count ++ ; } } to . put ( "extra_params" , builder . toString ( ) ) ; } } JSONArray networks = new JSONArray ( ) ; List < ShareType > thirdParties = from . getThirdParties ( ) ; if ( thirdParties != null && thirdParties . size ( ) > 0 ) { for ( ShareType socialNetwork : thirdParties ) { networks . put ( socialNetwork . name ( ) . toLowerCase ( ) ) ; } to . put ( "third_parties" , networks ) ; } }
/* (non-Javadoc)
@see com.socialize.entity.JSONFactory#toJSON(java.lang.Object, org.json.JSONObject)
/ * ( non - Javadoc )