diff --git a/src/main/java/xyz/zhouxy/plusone/commons/util/Assert.java b/src/main/java/xyz/zhouxy/plusone/commons/util/Assert.java index fea90b6..b1abfac 100644 --- a/src/main/java/xyz/zhouxy/plusone/commons/util/Assert.java +++ b/src/main/java/xyz/zhouxy/plusone/commons/util/Assert.java @@ -206,6 +206,19 @@ public class Assert { Assert.isTrue(!Strings.isNullOrEmpty(str), errorMessageTemplate, args); } + // hasText - String + public static void hasText(@Nullable String str, Supplier e) throws E { + Assert.isTrue(MoreStrings.hasText(str), e); + } + + public static void hasText(@Nullable String str, String errorMessage) { + Assert.isTrue(MoreStrings.hasText(str), errorMessage); + } + + public static void hasText(@Nullable String str, String errorMessageTemplate, Object... args) { + Assert.isTrue(MoreStrings.hasText(str), errorMessageTemplate, args); + } + // private constructor private Assert() { throw new IllegalStateException("Utility class");