All Downloads are FREE. Search and download functionalities are using the official Maven repository.

vip.ipav.okhttp.builder.OkHttpRequestBuilderHasParam Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version
package vip.ipav.okhttp.builder;

import vip.ipav.okhttp.OkHttpClientTools;
import java.util.LinkedHashMap;
import java.util.Map;
@SuppressWarnings("unchecked")
public abstract class OkHttpRequestBuilderHasParam extends OkHttpRequestBuilder {

    protected Map mParams;

    public OkHttpRequestBuilderHasParam(OkHttpClientTools okHttpClientTools) {
        super(okHttpClientTools);
    }

    /**
     * set Map params
     * @param params
     * @return
     */
    public T params(Map params) {
        this.mParams = params;
        return (T) this;
    }

    /**
     * add param
     * @param key param key
     * @param val param val
     * @return
     */
    public T addParam(String key, String val) {
        if (this.mParams == null)
        {
            mParams = new LinkedHashMap<>();
        }
        mParams.put(key, val);
        return (T) this;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy