Class DefaultValidator
java.lang.Object
tech.guilhermekaua.spigotboot.core.validation.DefaultValidator
- All Implemented Interfaces:
Validator
Default implementation of the Validator interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull ValidationResultValidates an object and returns all errors.@NotNull ValidationResultvalidate(@NotNull Object object, @NotNull PropertyPath basePath) Validates an object at a specific path context.voidvalidateOrThrow(@NotNull Object object) Validates and throws if invalid (for fail-fast mode).
-
Constructor Details
-
DefaultValidator
public DefaultValidator()
-
-
Method Details
-
validate
Description copied from interface:ValidatorValidates an object and returns all errors. -
validate
@NotNull public @NotNull ValidationResult validate(@NotNull @NotNull Object object, @NotNull @NotNull PropertyPath basePath) Description copied from interface:ValidatorValidates an object at a specific path context. -
validateOrThrow
Description copied from interface:ValidatorValidates and throws if invalid (for fail-fast mode).- Specified by:
validateOrThrowin interfaceValidator- Parameters:
object- the object to validate- Throws:
ValidationException- if validation fails
-