private Builder setMailboxList(String fieldName, Mailbox mailbox) { return setMailboxList(fieldName, mailbox == null ? null : Collections.singleton(mailbox)); }
private Builder setMailboxList(String fieldName, Mailbox... mailboxes) { return setMailboxList(fieldName, mailboxes == null ? null : Arrays.asList(mailboxes)); }
private Builder setMailboxList(String fieldName, String... mailboxes) throws ParseException { return setMailboxList(fieldName, parseMailboxes(mailboxes)); }
private Builder setMailboxList(String fieldName, String mailbox) throws ParseException { return setMailboxList(fieldName, mailbox == null ? null : DefaultAddressParser.DEFAULT.parseMailbox(mailbox)); }
/** * Sets <i>From</i> header field of this message to the specified * mailbox addresses. * * @param from * addresses to set or <code>null</code> or no arguments to * remove the header field. */ public Builder setFrom(Mailbox... from) { return setMailboxList(FieldName.FROM, from); }
/** * Sets <i>From</i> header field of this message to the specified * mailbox address. * * @param from * address to set or <code>null</code> to remove the header * field. */ public Builder setFrom(String from) throws ParseException { return setMailboxList(FieldName.FROM, from); }
/** * Sets <i>From</i> header field of this message to the specified * mailbox addresses. * * @param from * addresses to set or <code>null</code> or an empty collection * to remove the header field. */ public Builder setFrom(Collection<Mailbox> from) { return setMailboxList(FieldName.FROM, from); }
/** * Sets <i>From</i> header field of this message to the specified * mailbox addresses. * * @param from * addresses to set or <code>null</code> or no arguments to * remove the header field. */ public Builder setFrom(String... from) throws ParseException { return setMailboxList(FieldName.FROM, from); }
/** * Sets <i>From</i> header field of this message to the specified * mailbox address. * * @param from * address to set or <code>null</code> to remove the header * field. */ public Builder setFrom(Mailbox from) { return setMailboxList(FieldName.FROM, from); }