Skip to content

Validation

Overview

Jakarta validation helpers and reusable constraints.

Architecture

  • Constraint annotations: @Type4UUID, @StrictType4UUID, @IsValidKebabCase, @IsValidDottedCase.
  • Validators: KebabCaseValidator, DottedCaseValidator, IdentifierValidator.
  • ValidationUtils for programmatic validation and exception handling.

How to use

Gradle

implementation("ie.bitstep.mango:mango4j-validation:1.0.0")

Maven

1
2
3
4
5
<dependency>
    <groupId>ie.bitstep.mango</groupId>
    <artifactId>mango4j-validation</artifactId>
    <version>1.0.0</version>
</dependency>

Examples

1
2
3
4
5
6
7
8
9
class CreateRequest {
    @Type4UUID
    private String requestId;

    @IsValidKebabCase
    private String slug;
}

ValidationUtils.validate(request);