Skip to content

Instantly share code, notes, and snippets.

@mchmielarz
Last active May 31, 2019 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mchmielarz/4141bd44744707c057f1c045169750b2 to your computer and use it in GitHub Desktop.
Save mchmielarz/4141bd44744707c057f1c045169750b2 to your computer and use it in GitHub Desktop.
@Value
@Accessors(fluent = true)
public class Payload {
private final String body;
}
@Value
@Accessors(fluent = true)
public class EmailMessage {
private final Email email;
private final Payload payload;
}
public class EmailSender {
public SendingResult send(EmailMessage message) {
return new SendingResult(doSend(message.email(), message.payload().body()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment