java struct
Java 14 has added support for Records, which are structured data types that are very easy to build.
You can declare a Java record like this:
public record AuditInfo(
LocalDateTime createdOn,
String createdBy,
LocalDateTime updatedOn,
String updatedBy
) {}
public record PostInfo(
Long id,
String title,
AuditInfo auditInfo
) {}