时间格式化工具支持自定义设置单位

This commit is contained in:
Looly 2024-06-17 15:37:44 +08:00
parent bf19e86f4e
commit 47872765e3
2 changed files with 3 additions and 4 deletions

View File

@ -222,7 +222,7 @@ public class BetweenFormatter implements Serializable {
* @param levelFormatter 级别格式化器
* @return this
*/
public BetweenFormatter setLevelFormatter(Function<Level, String> levelFormatter) {
public BetweenFormatter setLevelFormatter(final Function<Level, String> levelFormatter) {
this.levelFormatter = levelFormatter;
return this;
}
@ -233,8 +233,8 @@ public class BetweenFormatter implements Serializable {
* @param separator 分割符
* @return this
*/
public BetweenFormatter setSeparator(String separator) {
this.separator = separator == null ? StrUtil.EMPTY : separator;
public BetweenFormatter setSeparator(final String separator) {
this.separator = StrUtil.emptyIfNull(separator);
return this;
}

View File

@ -12,7 +12,6 @@
package org.dromara.hutool.core.date;
import org.dromara.hutool.core.text.StrUtil;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;