messageBuilder.setDate(Date.from(newMessage.getDate().toInstant()), TimeZone.getTimeZone(newMessage.getDate().getZone())); newMessage.getInReplyToMessageId() .ifPresent(id -> addHeader(messageBuilder, IN_REPLY_TO_HEADER, id));
public MessageBuilder setDate(Date date, TimeZone zone) { builder.setDate(date, zone); return this; }
/** * Sets <i>Date</i> header field for this message. This method uses the * default <code>TimeZone</code> of this host to encode the specified * <code>Date</code> object into a string. * * @param date * date to set or <code>null</code> to remove the date header * field. */ public Builder setDate(Date date) { return setDate(date, null); }
public MessageBuilder setDate(Date date) { builder.setDate(date); return this; }