1
0
mirror of https://gitee.com/dromara/hutool.git synced 2025-04-05 17:37:59 +08:00
This commit is contained in:
Looly 2022-05-10 18:13:50 +08:00
parent 3df525409b
commit 15d4f786b2
4 changed files with 28 additions and 4 deletions
CHANGELOG.md
hutool-core/src/main/java/cn/hutool/core/text
hutool-db/src/main/java/cn/hutool/db/dialect

View File

@ -3,13 +3,15 @@
-------------------------------------------------------------------------------------------------------------
# 5.8.1.M1 (2022-05-09)
# 5.8.1.M1 (2022-05-10)
### 🐣新特性
* 【core 】 BooleanUtil增加toBooleanObject方法issue#I56AG3@Gitee
* 【core 】 CharSequenceUtil增加startWithAnyIgnoreCase方法issue#2312@Github
### 🐞Bug修复
* 【core 】 MapUtil.map对null友好且修复了测试用例中分组问题pr#614@Gitee
* 【core 】 修复BeanUtil.beanToMap中properties为null的空指针问题issue#2303@Github
* 【db 】 DialectName中修正为POSTGRESQLissue#2308@Github
-------------------------------------------------------------------------------------------------------------

View File

@ -780,6 +780,28 @@ public class CharSequenceUtil {
return false;
}
/**
* 给定字符串是否以任何一个字符串结尾忽略大小写<br>
* 给定字符串和数组为空都返回false
*
* @param str 给定字符串
* @param suffixes 需要检测的结尾字符串
* @return 给定字符串是否以任何一个字符串结尾
* @since 5.8.1
*/
public static boolean startWithAnyIgnoreCase(final CharSequence str, final CharSequence... suffixes) {
if (isEmpty(str) || ArrayUtil.isEmpty(suffixes)) {
return false;
}
for (final CharSequence suffix : suffixes) {
if (startWith(str, suffix, true)) {
return true;
}
}
return false;
}
// ------------------------------------------------------------------------ endWith
/**
@ -2707,7 +2729,7 @@ public class CharSequenceUtil {
* 如果想输出 {} 使用 \\转义 { 即可如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
* <br>
* 通常使用format("this is {} for {}", "a", "b") = this is a for b<br>
* 转义{} format("this is \\{} for {}", "a", "b") = this is \{} for a<br>
* 转义{} format("this is \\{} for {}", "a", "b") = this is {} for a<br>
* 转义\ format("this is \\\\{} for {}", "a", "b") = this is \a for b<br>
*
* @param template 文本模板被替换的部分用 {} 表示如果模板为null返回"null"

View File

@ -9,7 +9,7 @@ import cn.hutool.core.util.StrUtil;
* @author Looly
*/
public enum DialectName {
ANSI, MYSQL, ORACLE, POSTGREESQL, SQLITE3, H2, SQLSERVER, SQLSERVER2012, PHOENIX;
ANSI, MYSQL, ORACLE, POSTGRESQL, SQLITE3, H2, SQLSERVER, SQLSERVER2012, PHOENIX;
/**
* 是否为指定数据库方言检查时不分区大小写

View File

@ -28,7 +28,7 @@ public class PostgresqlDialect extends AnsiSqlDialect{
@Override
public String dialectName() {
return DialectName.POSTGREESQL.name();
return DialectName.POSTGRESQL.name();
}
@Override