Back to project page RealtimeStorage-Android.
The source code is released under:
MIT License
If you think the Android project RealtimeStorage-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package co.realtime.storage; //from w w w . j a va2 s . c o m import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.core.JsonProcessingException; class PostBodyBuilder { StorageContext context; Map <String, Object> body; PostBodyBuilder(StorageContext context){ this.context = context; body = new HashMap<String, Object>(); body.put("applicationKey", context.applicationKey); // TODO: remove this check after removing the private key if(context.privateKey!=null) body.put("privateKey", context.privateKey); if(context.authenticationToken != null) body.put("authenticationToken", context.authenticationToken); } void addObject(String key, Object value){ body.put(key, value); } Object getObject(String key){ return body.get(key); } String getBody() throws JsonProcessingException{ return context.mapper.writeValueAsString(this.body); } }