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.