Class MailHeader.Builder

java.lang.Object
de.espirit.firstspirit.access.MailHeader.Builder
Enclosing class:
MailHeader

public static class MailHeader.Builder extends Object
A builder for creating a new MailHeader.
Since:
5.2.601
  • Method Details

    • recipient

      @NotNull public @NotNull MailHeader.Builder recipient(@NotNull @NotNull String recipient)
      Adds one or more recipients (TO) to the mail header.
      Parameters:
      recipient - The recipient to add. Multiple recipients must be separated by a semicolon. Must not be null.
      Returns:
      the builder itself.
      Throws:
      IllegalArgumentException - if the domain of a recipient does not conform to RFC 3490
      Since:
      5.2.601
    • ccRecipient

      @NotNull public @NotNull MailHeader.Builder ccRecipient(@NotNull @NotNull String recipient)
      Adds one or more carbon copy recipients (CC) to the mail header.
      Parameters:
      recipient - The carbon copy recipient to add. Multiple recipients must be separated by a semicolon. Must not be null.
      Returns:
      the builder itself.
      Throws:
      IllegalArgumentException - if the domain of a recipient does not conform to RFC 3490
      Since:
      5.2.220702
    • bccRecipient

      @NotNull public @NotNull MailHeader.Builder bccRecipient(@NotNull @NotNull String recipient)
      Adds one or more blind carbon copy recipients (BCC) to the mail header.
      Parameters:
      recipient - The blind carbon copy recipient to add. Multiple recipients must be separated by a semicolon. Must not be null.
      Returns:
      the builder itself.
      Throws:
      IllegalArgumentException - if the domain of a recipient does not conform to RFC 3490
      Since:
      5.2.220702
    • sender

      @NotNull public @NotNull MailHeader.Builder sender(@NotNull @NotNull String sender)
      Sets the sender of this mail header. If a sender has been specified earlier for this builder, it is replaced.
      Parameters:
      sender - The sender to set, must not be null.
      Returns:
      the builder itself.
      Throws:
      IllegalArgumentException - if the domain of a recipient does not conform to RFC 3490
      Since:
      5.2.601
    • replyTo

      @NotNull public @NotNull MailHeader.Builder replyTo(@NotNull @NotNull String replyTo)
      Adds one or more reply-to addresses to the mail header.
      Parameters:
      replyTo - The reply-to address to add. Multiple addresses must be separated by a semicolon. Must not be null.
      Returns:
      the builder itself.
      Throws:
      IllegalArgumentException - if the domain of a recipient does not conform to RFC 3490
      Since:
      5.2.601
    • create

      @NotNull public @NotNull MailHeader create()
      Constructs a new MailHeader with the values of this builder.
      Returns:
      The mail header containing the values specified for the builder, never null.
      Since:
      5.2.601