Articles, Home

Java Keytool

The Java Keytool is a command line tool that can generate public key / private key pairs and store them in a Java KeyStore file.

Articles, Home

Enforcing Java Record Invariants With Bean Validation

Record types are one of the most awaited features in Java 14; they promise to “provide a compact syntax for declaring classes which are transparent holders for shallowly immutable data”. One example where records should be beneficial are data transfer objects (DTOs), as e.g. found in the remoting layer of enterprise applications. Typically, certain rules should be applied to the attributes of such DTO, e.g. in terms of allowed values. The goal of this blog post is to explore how such invariants can be enforced on record types, using annotation-based constraints as provided by the Bean Validation API.