@Test public void testSetBody() throws Exception { BodyPartBuilder builder = BodyPartBuilder.create(); Body body = BasicBodyFactory.INSTANCE.textBody("test"); Assert.assertNull(body.getParent()); builder.setBody(body); final BodyPart bodyPart = builder.build(); Assert.assertSame(body, bodyPart.getBody()); Assert.assertSame(bodyPart, body.getParent()); }
@Override public BodyPartBuilder setBody(Body body) { super.setBody(body); return this; }
BodyPartBuilder extends AbstractEntityBuilder { @Override public BodyPartBuilder setBody(Body body) { super.setBody(body); return this; } }
BodyPartBuilder extends AbstractEntityBuilder { @Override public BodyPartBuilder setBody(Body body) { super.setBody(body); return this; }  }
BodyPartBuilder extends AbstractEntityBuilder { @Override public BodyPartBuilder setBody(Body body) { super.setBody(body); return this; }  static BodyPartBuilder create(); BodyPartBuilder use(BodyFactory bodyFactory); @Override BodyPartBuilder setField(Field field); @Override AbstractEntityBuilder addField(Field field); @Override AbstractEntityBuilder removeFields(String name); @Override BodyPartBuilder setContentTransferEncoding(String contentTransferEncoding); @Override BodyPartBuilder setContentType(String mimeType, NameValuePair... parameters); @Override BodyPartBuilder setContentDisposition(String dispositionType); @Override BodyPartBuilder setContentDisposition(String dispositionType, String filename); @Override BodyPartBuilder setContentDisposition(String dispositionType, String filename, long size); @Override BodyPartBuilder setContentDisposition(String dispositionType,
                                                 String filename,
                                                 long size,
                                                 Date creationDate,
                                                 Date modificationDate,
                                                 Date readDate); @Override BodyPartBuilder setBody(Body body); @Override BodyPartBuilder setBody(TextBody textBody); @Override BodyPartBuilder setBody(BinaryBody binaryBody); @Override BodyPartBuilder setBody(Multipart multipart); @Override BodyPartBuilder setBody(Message message); BodyPartBuilder setBody(String text, Charset charset); BodyPartBuilder setBody(String text, String subtype, Charset charset); BodyPartBuilder setBody(byte[] bin, String mimeType); BodyPart build(); }
BodyPartBuilder extends AbstractEntityBuilder { @Override public BodyPartBuilder setBody(Body body) { super.setBody(body); return this; }  static BodyPartBuilder create(); BodyPartBuilder use(BodyFactory bodyFactory); @Override BodyPartBuilder setField(Field field); @Override AbstractEntityBuilder addField(Field field); @Override AbstractEntityBuilder removeFields(String name); @Override BodyPartBuilder setContentTransferEncoding(String contentTransferEncoding); @Override BodyPartBuilder setContentType(String mimeType, NameValuePair... parameters); @Override BodyPartBuilder setContentDisposition(String dispositionType); @Override BodyPartBuilder setContentDisposition(String dispositionType, String filename); @Override BodyPartBuilder setContentDisposition(String dispositionType, String filename, long size); @Override BodyPartBuilder setContentDisposition(String dispositionType,
                                                 String filename,
                                                 long size,
                                                 Date creationDate,
                                                 Date modificationDate,
                                                 Date readDate); @Override BodyPartBuilder setBody(Body body); @Override BodyPartBuilder setBody(TextBody textBody); @Override BodyPartBuilder setBody(BinaryBody binaryBody); @Override BodyPartBuilder setBody(Multipart multipart); @Override BodyPartBuilder setBody(Message message); BodyPartBuilder setBody(String text, Charset charset); BodyPartBuilder setBody(String text, String subtype, Charset charset); BodyPartBuilder setBody(byte[] bin, String mimeType); BodyPart build();  }