<commit_before>// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.organization;

import com.google.common.collect.ImmutableList;

import java.util.Collection;
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; }

}<commit_msg>Add support for html content<commit_after>// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.organization;

import com.google.common.collect.ImmutableList;

import java.util.Collection;
import java.util.Objects;
import java.util.Optional;

/**
 * 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;
    private final Optional<String> htmlMessage;

    public Mail(Collection<String> recipients, String subject, String message) {
        this(recipients, subject, message, Optional.empty());
    }

    public Mail(Collection<String> recipients, String subject, String message, String htmlMessage) {
        this(recipients, subject, message, Optional.of(htmlMessage));
    }

    Mail(Collection<String> recipients, String subject, String message, Optional<String> htmlMessage) {
        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);
        this.htmlMessage = Objects.requireNonNull(htmlMessage);
    }

    public Collection<String> recipients() { return recipients; }
    public String subject() { return subject; }
    public String message() { return message; }
    public Optional<String> htmlMessage() { return htmlMessage; }

}
{'fraction_non_alphanumeric': 0.09378292939936776, 'fraction_numerical': 0.0014049877063575693, 'mean_word_length': 3.893470790378007, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2282757', 'n_tokens_mistral': 741, 'n_tokens_neox': 703, 'n_words': 228}