Doco not final

1. Doco should not be 'final' so that it can be mocked using Mockito
* Replacing cast to String by String.valueOf(object). …
  * This is more useful because it invokes Object.toString() which means User can directly specify (type=TEXT/ATOM) without providing any translator for objects like List/Set/Enum etc.
* Adding doco formatter to avoid formatting issues in future code reviews.