Modeling a Mail message

Our Mail service is abstract and can be used for different purposes, so we will create a simple class to represent a mail message in our system. Our Mail class should look like this:

package springfive.airline.mailservice.domain;import lombok.Data;@Datapublic class Mail {  String from;  String to;  String subject;  String message;}

Easy, this class represents an abstract message on our system.

Get Spring 5.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.