@Test public void testSetFrom() throws Exception { MessageBuilder builder = MessageBuilder.create(); Mailbox mailbox1 = DefaultAddressParser.DEFAULT.parseMailbox("john.doe@example.net"); Mailbox mailbox2 = DefaultAddressParser.DEFAULT.parseMailbox("jane.doe@example.net"); builder.setFrom(mailbox1); Assert.assertEquals("john.doe@example.net", builder.getField("From") .getBody()); builder.setFrom(mailbox1, mailbox2); Assert.assertEquals("john.doe@example.net, jane.doe@example.net", builder.getField("From").getBody()); builder.setFrom(Arrays.asList(mailbox1, mailbox2)); Assert.assertEquals("john.doe@example.net, jane.doe@example.net", builder.getField("From").getBody()); builder.setFrom((Mailbox) null); Assert.assertNull(builder.getField("From")); }
public MessageBuilder setFrom(String... from) throws ParseException { builder.setFrom(from); return this; }
MessageBuilder { public MessageBuilder setFrom(String... from) throws ParseException { builder.setFrom(from); return this; } }
MessageBuilder { public MessageBuilder setFrom(String... from) throws ParseException { builder.setFrom(from); return this; } MessageBuilder(); private  MessageBuilder(Message.Builder builder); }
MessageBuilder { public MessageBuilder setFrom(String... from) throws ParseException { builder.setFrom(from); return this; } MessageBuilder(); private  MessageBuilder(Message.Builder builder); static MessageBuilder create(); static MessageBuilder createCopy(Message other); static MessageBuilder read(InputStream is); MessageBuilder enableFlatMode(); MessageBuilder disableFlatMode(); MessageBuilder enableContentDecoding(); MessageBuilder disableContentDecoding(); MessageBuilder setField(Field field); MessageBuilder addField(Field field); Field getField(String name); F getField(final String name, final Class<F> clazz); List<Field> getFields(); List<F> getFields(final String name, final Class<F> clazz); MessageBuilder removeFields(String name); MessageBuilder clearFields(); boolean containsField(String name); String getMimeType(); String getCharset(); String getContentTransferEncoding(); MessageBuilder setContentType(String mimeType, NameValuePair... parameters); MessageBuilder setContentTransferEncoding(String contentTransferEncoding); String getDispositionType(); MessageBuilder setContentDisposition(String dispositionType); MessageBuilder setContentDisposition(String dispositionType, String filename); MessageBuilder setContentDisposition(String dispositionType, String filename, long size); MessageBuilder setContentDisposition(String dispositionType, String filename, long size, Date creationDate, Date modificationDate, Date readDate); Body getBody(); MessageBuilder setBody(Multipart multipart); MessageBuilder setBody(Message message); MessageBuilder setBody(Body body); MessageBuilder setBody(TextBody textBody); MessageBuilder setBody(BinaryBody binaryBody); MessageBuilder setBody(String text, Charset charset); MessageBuilder setBody(String text, String subtype, Charset charset); MessageBuilder setBody(byte[] bin, String mimeType); String getFilename(); long getSize(); Date getCreationDate(); Date getModificationDate(); Date getReadDate(); String getMessageId(); MessageBuilder setMessageId(String messageId); MessageBuilder generateMessageId(String hostname); String getSubject(); MessageBuilder setSubject(String subject); Date getDate(); MessageBuilder setDate(Date date); MessageBuilder setDate(Date date, TimeZone zone); Mailbox getSender(); MessageBuilder setSender(Mailbox sender); MessageBuilder setSender(String sender); MailboxList getFrom(); MessageBuilder setFrom(String... from); MessageBuilder setFrom(Collection<Mailbox> from); MessageBuilder setFrom(Mailbox from); MessageBuilder setFrom(String from); MessageBuilder setFrom(Mailbox... from); AddressList getTo(); MessageBuilder setTo(String... to); MessageBuilder setTo(Collection<? extends Address> to); MessageBuilder setTo(Address to); MessageBuilder setTo(String to); MessageBuilder setTo(Address... to); AddressList getCc(); MessageBuilder setCc(Address... cc); MessageBuilder setCc(Collection<? extends Address> cc); MessageBuilder setCc(Address cc); AddressList getBcc(); MessageBuilder setBcc(Address... bcc); MessageBuilder setBcc(Collection<? extends Address> bcc); MessageBuilder setBcc(Address bcc); MessageBuilder copy(Message other); MessageBuilder parse(InputStream is); AddressList getReplyTo(); MessageBuilder setReplyTo(Address... replyTo); MessageBuilder setReplyTo(Collection<? extends Address> replyTo); MessageBuilder setReplyTo(Address replyTo); MessageBuilder use(MimeConfig config); MessageBuilder use(DecodeMonitor monitor); MessageBuilder use(BodyDescriptorBuilder bodyDescBuilder); MessageBuilder use(FieldParser<?> fieldParser); MessageBuilder use(BodyFactory bodyFactory); Message build(); }
MessageBuilder { public MessageBuilder setFrom(String... from) throws ParseException { builder.setFrom(from); return this; } MessageBuilder(); private  MessageBuilder(Message.Builder builder); static MessageBuilder create(); static MessageBuilder createCopy(Message other); static MessageBuilder read(InputStream is); MessageBuilder enableFlatMode(); MessageBuilder disableFlatMode(); MessageBuilder enableContentDecoding(); MessageBuilder disableContentDecoding(); MessageBuilder setField(Field field); MessageBuilder addField(Field field); Field getField(String name); F getField(final String name, final Class<F> clazz); List<Field> getFields(); List<F> getFields(final String name, final Class<F> clazz); MessageBuilder removeFields(String name); MessageBuilder clearFields(); boolean containsField(String name); String getMimeType(); String getCharset(); String getContentTransferEncoding(); MessageBuilder setContentType(String mimeType, NameValuePair... parameters); MessageBuilder setContentTransferEncoding(String contentTransferEncoding); String getDispositionType(); MessageBuilder setContentDisposition(String dispositionType); MessageBuilder setContentDisposition(String dispositionType, String filename); MessageBuilder setContentDisposition(String dispositionType, String filename, long size); MessageBuilder setContentDisposition(String dispositionType, String filename, long size, Date creationDate, Date modificationDate, Date readDate); Body getBody(); MessageBuilder setBody(Multipart multipart); MessageBuilder setBody(Message message); MessageBuilder setBody(Body body); MessageBuilder setBody(TextBody textBody); MessageBuilder setBody(BinaryBody binaryBody); MessageBuilder setBody(String text, Charset charset); MessageBuilder setBody(String text, String subtype, Charset charset); MessageBuilder setBody(byte[] bin, String mimeType); String getFilename(); long getSize(); Date getCreationDate(); Date getModificationDate(); Date getReadDate(); String getMessageId(); MessageBuilder setMessageId(String messageId); MessageBuilder generateMessageId(String hostname); String getSubject(); MessageBuilder setSubject(String subject); Date getDate(); MessageBuilder setDate(Date date); MessageBuilder setDate(Date date, TimeZone zone); Mailbox getSender(); MessageBuilder setSender(Mailbox sender); MessageBuilder setSender(String sender); MailboxList getFrom(); MessageBuilder setFrom(String... from); MessageBuilder setFrom(Collection<Mailbox> from); MessageBuilder setFrom(Mailbox from); MessageBuilder setFrom(String from); MessageBuilder setFrom(Mailbox... from); AddressList getTo(); MessageBuilder setTo(String... to); MessageBuilder setTo(Collection<? extends Address> to); MessageBuilder setTo(Address to); MessageBuilder setTo(String to); MessageBuilder setTo(Address... to); AddressList getCc(); MessageBuilder setCc(Address... cc); MessageBuilder setCc(Collection<? extends Address> cc); MessageBuilder setCc(Address cc); AddressList getBcc(); MessageBuilder setBcc(Address... bcc); MessageBuilder setBcc(Collection<? extends Address> bcc); MessageBuilder setBcc(Address bcc); MessageBuilder copy(Message other); MessageBuilder parse(InputStream is); AddressList getReplyTo(); MessageBuilder setReplyTo(Address... replyTo); MessageBuilder setReplyTo(Collection<? extends Address> replyTo); MessageBuilder setReplyTo(Address replyTo); MessageBuilder use(MimeConfig config); MessageBuilder use(DecodeMonitor monitor); MessageBuilder use(BodyDescriptorBuilder bodyDescBuilder); MessageBuilder use(FieldParser<?> fieldParser); MessageBuilder use(BodyFactory bodyFactory); Message build();  }