Package org.aoju.bus.core.codec
Class Percent.Builder
java.lang.Object
org.aoju.bus.core.codec.Percent.Builder
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.aoju.bus.core.builder.Builder
Builder.HashKey -
Method Summary
Modifier and TypeMethodDescriptionaddSafe(char c) 增加安全字符 安全字符不被编码增加安全字符 安全字符不被编码build()包装唯一键(System.identityHashCode())使对象只有和自己 equals 此对象用于消除小概率下System.identityHashCode()产生的ID重复问题static Percent.Builderof(CharSequence chars) 创建Percent,使用指定字符串中的字符作为安全字符static Percent.Builder从已知Percent创建Percent,会复制给定Percent的安全字符增加安全字符到当前的PercentremoveSafe(char c) 移除安全字符 安全字符不被编码setEncodeSpaceAsPlus(boolean encodeSpaceAsPlus) 是否将空格编码为+ 如果为true,则将空格编码为"+",此项只在"application/x-www-form-urlencoded"中使用 如果为false,则空格编码为"%20",此项一般用于URL的Query部分(RFC3986规范)
-
Method Details
-
of
从已知Percent创建Percent,会复制给定Percent的安全字符- Parameters:
codec- Percent- Returns:
- this
-
of
创建Percent,使用指定字符串中的字符作为安全字符- Parameters:
chars- 安全字符合集- Returns:
- this
-
addSafe
-
addSafes
增加安全字符 安全字符不被编码- Parameters:
chars- 安全字符- Returns:
- this
-
removeSafe
-
or
增加安全字符到当前的Percent- Parameters:
other-Percent- Returns:
- this
-
setEncodeSpaceAsPlus
是否将空格编码为+ 如果为true,则将空格编码为"+",此项只在"application/x-www-form-urlencoded"中使用 如果为false,则空格编码为"%20",此项一般用于URL的Query部分(RFC3986规范)- Parameters:
encodeSpaceAsPlus- 是否将空格编码为+- Returns:
- this
-
build
-