Last active
March 31, 2022 10:11
-
-
Save Gogetter/aa75514ddb5f052daec04f23c4e2444c to your computer and use it in GitHub Desktop.
EmailData as a record class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public record EmailData( | |
String recipient, | |
String subject, | |
String message, | |
Set<EmailAttachment> emailAttachments) { | |
public EmailData { | |
Objects.requireNonNull(recipient); | |
subject = Objects.requireNonNullElse(subject, ""); | |
message = Objects.requireNonNullElse(message, ""); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment