[ https://issues.apache.org/jira/browse/MIME4J-272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tellier Benoit resolved MIME4J-272. ----------------------------------- Resolution: Fixed https://github.com/linagora/james-mime4j/pull/14 solved the issue > Ease builder uses by implicitly calling build when possible. > ------------------------------------------------------------ > > Key: MIME4J-272 > URL: https://issues.apache.org/jira/browse/MIME4J-272 > Project: James Mime4j > Issue Type: Improvement > Components: dom > Reporter: Tellier Benoit > Priority: Major > > While using mime4J DOM builders, we often ends up using builders to build a > builder argument. > However, the caller needs to convert the builder into the wanted object > calling the build method. This conversion can be a bit boiler plate. Thus > Mime4J should offer an opportunity to implicitly call "build" in non > ambiguoud situations. > Example: > {code:java} > Message message = Message.Builder.of() > .setBody(MultipartBuilder.create("report") > .addBodyPart(BodyPartBuilder.create() > .setBody(SingleBodyBuilder.create() > .setText("first") > .buildText()) > .build()) > .addBodyPart(mdn) > .build()) > .build(); > {code} > Would become: > {code:java} > Message message = Message.Builder.of() > .setBody(MultipartBuilder.create("report") > .addBodyPart(BodyPartBuilder.create() > .setBody(SingleBodyBuilder.create() > .setText("first") > .buildText())) > .addBodyPart(mdn)) > .build(); > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)