gunnarmorling / records-bean-validation

Example showing how to apply Bean Validation constraints to the components of Java 14 record types

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enforcing Java 14 Record Invariants with Bean Validation

Example code accompanying the blog post "Enforcing Java Record Invariants With Bean Validation". It shows how to apply Bean Validation constraints to the components of record types and automatically validate them upon constructor invocation, by means of injecting logic for invoking Bean Validation's method validation API and raising an exception in case of any violations.

Enforcing Java 14 Record Invariants with Bean Validation

Build

Run the following to build this project:

export MAVEN_OPTS="--enable-preview"
mvn clean package

License

This code base is available ander the Apache License, version 2.

About

Example showing how to apply Bean Validation constraints to the components of Java 14 record types

License:Apache License 2.0


Languages

Language:Java 87.8%Language:Shell 12.2%