diff --git a/plusone-validator/src/main/java/xyz/zhouxy/plusone/validator/BasePropertyValidator.java b/plusone-validator/src/main/java/xyz/zhouxy/plusone/validator/BasePropertyValidator.java index d3255b5..8350810 100644 --- a/plusone-validator/src/main/java/xyz/zhouxy/plusone/validator/BasePropertyValidator.java +++ b/plusone-validator/src/main/java/xyz/zhouxy/plusone/validator/BasePropertyValidator.java @@ -100,6 +100,10 @@ public abstract class BasePropertyValidator // ====== notEmpty ===== + public CollectionPropertyValidator notEmpty() { + return notEmpty("The input must not be empty."); + } + public CollectionPropertyValidator notEmpty(String errMsg) { return notEmpty(convertExceptionCreator(errMsg)); } - public CollectionPropertyValidator notEmpty(Supplier exceptionCreator) { + public CollectionPropertyValidator notEmpty( + Supplier exceptionCreator) { return notEmpty(convertExceptionCreator(exceptionCreator)); } @@ -47,11 +52,16 @@ public class CollectionPropertyValidator // ====== isEmpty ===== + public CollectionPropertyValidator isEmpty() { + return isEmpty("The input must be empty."); + } + public CollectionPropertyValidator isEmpty(String errMsg) { return isEmpty(convertExceptionCreator(errMsg)); } - public CollectionPropertyValidator isEmpty(Supplier exceptionCreator) { + public CollectionPropertyValidator isEmpty( + Supplier exceptionCreator) { return isEmpty(convertExceptionCreator(exceptionCreator)); }