This recipe will show you how you can use the power of the new JSON-B API to give some flexibility to your data representation, and also help to transform your objects into JSON messages.
Easing data and objects representation with JSON-B
Getting ready
Start by adding the Java EE dependency:
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>
</dependencies>