public class Builder extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Builder.Status |
static class |
Builder.Token |
static class |
Builder.Type
缓存类型
|
| Modifier and Type | Method and Description |
|---|---|
static String |
appendIfNotContain(String str,
String appendStr,
String otherwise)
如果给定字符串
str中不包含appendStr,则在str后追加appendStr;
如果已包含appendStr,则在str后追加otherwise |
String |
build()
构造url
|
String |
build(boolean encode)
构造url
|
static String |
encode(String value)
编码
|
static Builder |
fromBaseUrl(String baseUrl) |
static String |
parseMapToString(Map<String,Object> params,
boolean encode)
map转字符串,转换后的字符串格式为
xxx=xxx&xxx=xxx |
Builder |
queryParam(String key,
Object value)
添加参数
|
public static Builder fromBaseUrl(String baseUrl)
baseUrl - 基础路径UrlBuilderpublic static String appendIfNotContain(String str, String appendStr, String otherwise)
str中不包含appendStr,则在str后追加appendStr;
如果已包含appendStr,则在str后追加otherwisestr - 给定的字符串appendStr - 需要追加的内容otherwise - 当appendStr不满足时追加到str后的内容public static String parseMapToString(Map<String,Object> params, boolean encode)
xxx=xxx&xxx=xxxparams - 待转换的mapencode - 是否转码public Builder queryParam(String key, Object value)
key - 参数名称value - 参数值public String build()
public String build(boolean encode)
encode - 转码Copyright © 2020. All rights reserved.