Back to project page NetworkFacade.
The source code is released under:
Apache License
If you think the Android project NetworkFacade 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 com.saguinav.networkfacade; /*from w w w .j a v a2s . co m*/ import java.util.HashMap; import java.util.Map; public interface HttpBody { String getContent(); String getType(); String getEncoding(); static class Hidden { protected static class DefaultHttpBody implements HttpBody { private final String content; private final String type; private final String encoding; private DefaultHttpBody(String content, String type, String encoding) { this.content = content; this.type = type; this.encoding = encoding; } protected DefaultHttpBody(Builder builder) { this(builder.getContent(), builder.getType(), builder.getEncoding()); } public String getContent() { return content; } public String getType() { return type; } public String getEncoding() { return encoding; } } } public static abstract class Builder extends Hidden.DefaultHttpBody { private final Map<String, String> mParams = new HashMap<String, String>(); public Builder(String type, String encoding) { super(null, type, encoding); } public Builder param(String name, String value) { if (name != null && !name.equals("") && value != null) { mParams.put(name, value); } return this; } public Map<String, String> getParams() { return mParams; } public abstract HttpBody build(); } }