@ JsonView ( EventViews . ContentOnly . class ) @ JsonProperty ( "content" ) private Map < String , Object > getJsonSerializingContent ( ) { //noinspection unchecked return ( Map < String , Object > ) _content ; }
For purposes of JSON serialization wrapping the content in an unmodifiable view may cause the serializer to choose a less - optimal implementation . Since JSON serialization cannot modify the underlying content it is safe to return the original content object to the serializer .