Demo project about building a immutable fluent api with FluApiGen.
Please check the following article on medium
Creates a small fluent api for configuring and creating email data objects.
The example basically consists only of two files:
It will generate a Builder Class EmailDataBuilder which then can be used as starting pointb for fluent api:
EmailFluentApi.EmailBB emailBB = EmailDataBuilder
.withSender("tobias.stamann@holisticon.de")
.withRecipients()
.cc("tobias1@holisticon.de")
.and().to("tobias2@holisticon.de")
.and().bcc("tobias3@holisticon.de")
.and().to("tobias4@holisticon.de")
.withSubject("Test")
.withBody("LOREM IPSUM")
.addAttachment().withCustomName("itWorks.png").fromFile(new File("abc.png"))
.build();