From 22e3e046d4fa09daad99447935687ff6be72238e Mon Sep 17 00:00:00 2001 From: smallchill Date: Sat, 18 May 2024 12:46:45 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20setValueIfBlank=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=B3=9B=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/springblade/core/tool/utils/ValidationUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ValidationUtil.java b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ValidationUtil.java index 196fb44..191b9ef 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ValidationUtil.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/ValidationUtil.java @@ -47,8 +47,8 @@ public class ValidationUtil { * @param setter 字段的setter方法 * @param valueSupplier 默认值提供方法 */ - public static void setValueIfBlank(Supplier getter, Consumer setter, Supplier valueSupplier) { - if (StringUtil.isBlank(getter.get())) { + public static void setValueIfBlank(Supplier getter, Consumer setter, Supplier valueSupplier) { + if (ObjectUtil.isEmpty(getter.get())) { setter.accept(valueSupplier.get()); } }