Skip to content

malczuuu/jakarta-validation-extensions

Repository files navigation

Jakarta Validation Extensions

Build Status Sonatype License

This project provides additional features and extensions for Jakarta Validation (Bean Validation). It includes custom validation annotations.

A small project to experiment with publishing artifacts to Maven Central and see what eventually comes of it.

Usage

Add library as dependency to Maven or Gradle. See the actual versions on Maven Central. Java 11 or higher is required to use this library.

  • Maven
    <dependency>
        <groupId>io.github.malczuuu</groupId>
        <artifactId>jakarta-validation-extensions</artifactId>
        <version>1.1.0</version>
    </dependency>
  • Gradle
    dependencies {
        implementation("io.github.malczuuu:jakarta-validation-extensions:1.1.0")
    }

Features

  • @OneOf - validates that a value is one of the specified values. Supported types include CharSequence (generic for String in particular, but also StringBuilder etc.), Number, Enum and Character.
  • @Alphanumeric - validates that a value contains only alphanumeric characters (a-z, A-Z, 0-9), with optional characters to ignore. Supported types include CharSequence, and Character.

Versioning

This project follows Semantic Versioning.

Building from source

Expand...

To build the project from source, ensure you have Java 17 or higher. Yes, Java 17 is required to build the project, but it should produce artifacts compatible with Java 11.

./gradlew clean build
./gradlew -Pversion=XXXX clean build publishToMavenLocal

About

A tiny set of annotations that extend Jakarta Bean Validation

Topics

Resources

License

Stars

Watchers

Forks