add method

This commit is contained in:
Looly 2021-10-18 16:54:25 +08:00
parent 644d1c22c7
commit e04789c322
2 changed files with 15 additions and 1 deletions

View File

@ -3,7 +3,7 @@
-------------------------------------------------------------------------------------------------------------
# 5.7.15 (2021-10-16)
# 5.7.15 (2021-10-18)
### 🐣新特性
* 【db 】 Db.quietSetAutoCommit增加判空issue#I4D75B@Gitee
@ -11,6 +11,7 @@
* 【core 】 Assert增加checkBetween重载pr#436@Gitee
* 【core 】 ReUtil增加命名分组重载pr#439@Gitee
* 【json 】 toString和writer增加Filterissue#I4DQNQ@Gitee
* 【core 】 ContentType增加build重载pr#1898@Github
*
### 🐞Bug修复
* 【core 】 修复CollUtil.isEqualList两个null返回错误问题issue#1885@Github

View File

@ -45,6 +45,7 @@ public enum ContentType {
/**
* 构造
*
* @param value ContentType值
*/
ContentType(String value) {
@ -141,4 +142,16 @@ public enum ContentType {
public static String build(String contentType, Charset charset) {
return StrUtil.format("{};charset={}", contentType, charset.name());
}
/**
* 输出Content-Type字符串附带编码信息
*
* @param contentType Content-Type 枚举类型
* @param charset 编码
* @return Content-Type字符串
* @since 5.7.15
*/
public static String build(ContentType contentType, Charset charset) {
return build(contentType.getValue(), charset);
}
}