@SuppressWarnings("deprecation") public static MaybeSender of(MailAddress mailAddress) { return new MaybeSender(Optional.ofNullable(mailAddress) .filter(address -> !address.isNullSender())); }
public static MaybeSender of(MailAddress mailAddress) { return new MaybeSender(Optional.ofNullable(mailAddress) .filter(address -> !address.isNullSender())); }
public void setRecipients(List<MailAddress> recipients) { if (!recipients.isEmpty()) { mail.setRecipients(recipients .stream() .filter(address -> !address.isNullSender()) .collect(ImmutableList.toImmutableList())); if (mailet.getInitParameters().isDebug()) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("recipients set to: {}", (Object) recipients.toArray()); } } } }
} else if (obj instanceof MailAddress) { MailAddress that = (MailAddress) obj; boolean bothNullSender = this.isNullSender() && that.isNullSender(); boolean onlyOneIsNullSender = isNullSender() ^ that.isNullSender();
} else if (obj instanceof MailAddress) { MailAddress that = (MailAddress) obj; boolean bothNullSender = this.isNullSender() && that.isNullSender(); boolean onlyOneIsNullSender = isNullSender() ^ that.isNullSender();
if (mailAddress.isNullSender()) { return ImmutableList.of();
/** * <p> * Sets the "Reply-To:" header of <i>newMail</i> to <i>replyTo</i>. * </p> * If the requested value is <code>SpecialAddress.NULL</code> will remove * the "Reply-To:" header. If the requested value is null does nothing.</p> */ public void setReplyTo(Optional<MailAddress> optionalReplyTo) throws MessagingException { if (optionalReplyTo.isPresent()) { MailAddress replyTo = optionalReplyTo.get(); if (replyTo.isNullSender() || replyTo.equals(SpecialAddress.NULL)) { mail.getMessage().setReplyTo(null); if (mailet.getInitParameters().isDebug()) { LOGGER.debug("replyTo set to: null"); } } else { mail.getMessage().setReplyTo(new InternetAddress[] { replyTo.toInternetAddress() }); if (mailet.getInitParameters().isDebug()) { LOGGER.debug("replyTo set to: {}", replyTo); } } } }