Interface Validator

All Known Implementing Classes:
DefaultValidator

public interface Validator
Validates objects based on their annotations.
  • Method Details

    • validate

      @NotNull @NotNull ValidationResult validate(@NotNull @NotNull Object object)
      Validates an object and returns all errors.
      Parameters:
      object - the object to validate
      Returns:
      the validation result
    • validate

      @NotNull @NotNull ValidationResult validate(@NotNull @NotNull Object object, @NotNull @NotNull PropertyPath basePath)
      Validates an object at a specific path context.
      Parameters:
      object - the object to validate
      basePath - the base path for error reporting
      Returns:
      the validation result
    • validateOrThrow

      void validateOrThrow(@NotNull @NotNull Object object) throws ValidationException
      Validates and throws if invalid (for fail-fast mode).
      Parameters:
      object - the object to validate
      Throws:
      ValidationException - if validation fails
    • create

      @NotNull static @NotNull Validator create()
      Creates a default validator.
      Returns:
      a new validator