blob: 38b9cd4db5a8c076e753a244adb1d149e23ad1c0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
package com.yahoo.vespa.hosted.controller.api.integration.organization;
import com.google.common.collect.ImmutableList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
/**
* A message with a subject and a nonempty set of recipients.
*
* @author jonmv
*/
public class Mail {
private final Collection<String> recipients;
private final String subject;
private final String message;
public Mail(Collection<String> recipients, String subject, String message) {
if (recipients.isEmpty())
throw new IllegalArgumentException("Empty recipient list is not allowed.");
recipients.forEach(Objects::requireNonNull);
this.recipients = ImmutableList.copyOf(recipients);
this.subject = Objects.requireNonNull(subject);
this.message = Objects.requireNonNull(message);
}
public Collection<String> recipients() { return recipients; }
public String subject() { return subject; }
public String message() { return message; }
}
|