tdiesler/fabric8poc — pull request #8 by iocanel (2014-05-02 10:45:50+00:00)
Title: Add a nested profile builder inside the profile version builder

Currently the ProfileVersionBuilder is able to create a ProfileBuilder which the user can use to create profile and add them to the version, like the snippet below:

````java
ProfileVersionBuilder versionBuilder = ProfileVersionBuilder.Factory.create(version);
ProfileVersion linkedVersion = versionBuilder
.addProfile(versionBuilder.getProfileBuilder(identityA)
.addConfigurationItem("confItem", configA)
.build())
.addProfile(versionBuilder.getProfileBuilder(identityB)
.addParentProfile(identityA)
.addConfigurationItem("confItem", configB)
.build())
.build()
````
We could remove the need of carrying around the version builder instance by allowing the ProfileVersionBuilder to use a nested profile builder. The snippet above could become:

````java
ProfileVersion linkedVersion = ProfileVersionBuilder.Factory.create(version)
.withProfile(identityA)
.addConfigurationItem("confItem", configA)
.and()
. withProfile(identityB)
.addParentProfile(identityA)
.addConfigurationItem("confItem", configB)
.and()
.build()
````
This is a small improvement in terms of cleaness, but does remove the burden of having to keep track which are the builder ones need to hold a reference to.

This PR adds the concept of composite/nested builder and applies it in the example above.