Class ValidationUtils
java.lang.Object
api.mpba.rastvdmy.service.validator.ValidationUtils
Utility class for common validation methods.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
throwApplicationException
(String message) Throws an ApplicationException with the given message.static void
validateNotEmpty
(String field, String message) Validates that the given field is not empty or null.
-
Constructor Details
-
ValidationUtils
public ValidationUtils()
-
-
Method Details
-
validateNotEmpty
Validates that the given field is not empty or null.- Parameters:
field
- the field to validatemessage
- the error message to throw if the field is empty or null- Throws:
ApplicationException
- if the field is empty or null
-
throwApplicationException
Throws an ApplicationException with the given message.- Parameters:
message
- the error message- Throws:
ApplicationException
- always thrown with the given message
-