mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
fix bug
This commit is contained in:
parent
ba4fabb88c
commit
0595b91634
@ -9,6 +9,7 @@
|
||||
### 🐞Bug修复
|
||||
* 【core 】 修复FuncKey函数无效问题
|
||||
* 【core 】 修复ImgUtil.copyImage读取网络URL后宽高报错问题(issue#1821@Github)
|
||||
* 【core 】 修复StrJoiner.append配置丢失问题(issue#I49K1L@Gitee)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -33,22 +33,38 @@ public class StrJoiner implements Appendable {
|
||||
private boolean hasContent;
|
||||
|
||||
/**
|
||||
* 使用指定分隔符创建{@link StrJoiner}
|
||||
* 根据已有StrJoiner配置新建一个新的StrJoiner
|
||||
*
|
||||
* @param joiner 已有StrJoiner
|
||||
* @return 新的StrJoiner,配置相同
|
||||
* @since 5.7.12
|
||||
*/
|
||||
public static StrJoiner of(StrJoiner joiner) {
|
||||
StrJoiner joinerNew = new StrJoiner(joiner.delimiter, joiner.prefix, joiner.suffix);
|
||||
joinerNew.wrapElement = joiner.wrapElement;
|
||||
joinerNew.nullMode = joiner.nullMode;
|
||||
joinerNew.emptyResult = joiner.emptyResult;
|
||||
|
||||
return joinerNew;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用指定分隔符创建StrJoiner
|
||||
*
|
||||
* @param delimiter 分隔符
|
||||
* @return {@link StrJoiner}
|
||||
* @return StrJoiner
|
||||
*/
|
||||
public static StrJoiner of(CharSequence delimiter) {
|
||||
return new StrJoiner(delimiter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用指定分隔符创建{@link StrJoiner}
|
||||
* 使用指定分隔符创建StrJoiner
|
||||
*
|
||||
* @param delimiter 分隔符
|
||||
* @param prefix 前缀
|
||||
* @param suffix 后缀
|
||||
* @return {@link StrJoiner}
|
||||
* @return StrJoiner
|
||||
*/
|
||||
public static StrJoiner of(CharSequence delimiter, CharSequence prefix, CharSequence suffix) {
|
||||
return new StrJoiner(delimiter, prefix, suffix);
|
||||
@ -200,7 +216,7 @@ public class StrJoiner implements Appendable {
|
||||
* @return this
|
||||
*/
|
||||
public <T> StrJoiner append(T[] array) {
|
||||
if(null == array){
|
||||
if (null == array) {
|
||||
return this;
|
||||
}
|
||||
return append(new ArrayIter<>(array));
|
||||
@ -214,10 +230,10 @@ public class StrJoiner implements Appendable {
|
||||
* @return this
|
||||
*/
|
||||
public <T> StrJoiner append(Iterator<T> iterator) {
|
||||
if(null == iterator){
|
||||
if (null == iterator) {
|
||||
return this;
|
||||
}
|
||||
return append(iterator, (t) -> StrJoiner.of(this.delimiter).append(t).toString());
|
||||
return append(iterator, (t) -> StrJoiner.of(this).append(t).toString());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -301,7 +317,7 @@ public class StrJoiner implements Appendable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if(null == this.appendable){
|
||||
if (null == this.appendable) {
|
||||
return emptyResult;
|
||||
}
|
||||
if (false == wrapElement && StrUtil.isNotEmpty(this.suffix)) {
|
||||
|
Loading…
Reference in New Issue
Block a user