Class DefaultValidator

java.lang.Object
tech.guilhermekaua.spigotboot.core.validation.DefaultValidator
All Implemented Interfaces:
Validator

public class DefaultValidator extends Object implements Validator
Default implementation of the Validator interface.
  • Constructor Details

    • DefaultValidator

      public DefaultValidator()
  • Method Details

    • validate

      @NotNull public @NotNull ValidationResult validate(@NotNull @NotNull Object object)
      Description copied from interface: Validator
      Validates an object and returns all errors.
      Specified by:
      validate in interface Validator
      Parameters:
      object - the object to validate
      Returns:
      the validation result
    • validate

      @NotNull public @NotNull ValidationResult validate(@NotNull @NotNull Object object, @NotNull @NotNull PropertyPath basePath)
      Description copied from interface: Validator
      Validates an object at a specific path context.
      Specified by:
      validate in interface Validator
      Parameters:
      object - the object to validate
      basePath - the base path for error reporting
      Returns:
      the validation result
    • validateOrThrow

      public void validateOrThrow(@NotNull @NotNull Object object) throws ValidationException
      Description copied from interface: Validator
      Validates and throws if invalid (for fail-fast mode).
      Specified by:
      validateOrThrow in interface Validator
      Parameters:
      object - the object to validate
      Throws:
      ValidationException - if validation fails