java.lang.Object
jp.ecuacion.lib.core.util.ValidationUtil
Provides validation-related utilities.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetMessagePostfix(PropertyFileUtil.Arg messagePostfix) SetsmessagePostfixand returns this for method chain.setMessagePrefix(PropertyFileUtil.Arg messagePrefix) SetsmessagePrefixand returns this for method chain.setMessageWithItemName(boolean isMessageWithItemName) SetsmessageWithItemNameand returns this for method chain.<T> Set<jakarta.validation.ConstraintViolation<T>> validate(T object) Validates and returnsConstraintViolationif validation errors exist.validateThenReturn(T object) Validates and returnsMultipleAppExceptionif validation errors exist.<T> voidvalidateThenThrow(T object) Validates and throwsMultipleAppExceptionif validation errors exist.
-
Constructor Details
-
ValidationUtil
public ValidationUtil()
-
-
Method Details
-
validateThenThrow
Validates and throwsMultipleAppExceptionif validation errors exist.- Type Parameters:
T- any class- Parameters:
object- object to validate- Throws:
MultipleAppException- MultipleAppException
-
validateThenReturn
Validates and returnsMultipleAppExceptionif validation errors exist.- Type Parameters:
T- any class- Parameters:
object- object which is treated asLocale.getDefault().- Returns:
- MultipleAppException, may be null when no validation errors exist.
-
validate
@Nonnull public <T> Set<jakarta.validation.ConstraintViolation<T>> validate(@RequireNonnull T object) Validates and returnsConstraintViolationif validation errors exist.- Type Parameters:
T- any class- Parameters:
object- object to validate- Returns:
- a Set of ConstraintViolation, may be null when no validation errors exist.
- See Also:
-
setMessageWithItemName
SetsmessageWithItemNameand returns this for method chain.- Parameters:
isMessageWithItemName- isMessageWithItemName- Returns:
- BeanValidationUtil
-
setMessagePrefix
SetsmessagePrefixand returns this for method chain.- Parameters:
messagePrefix- messagePrefix- Returns:
- BeanValidationUtil
-
setMessagePostfix
SetsmessagePostfixand returns this for method chain.- Parameters:
messagePostfix- messagePostfix- Returns:
- BeanValidationUtil
-