@Throws(Exception::class) protected fun toJsonBytes(`object`: Any?): ByteArray? { val mapper = ObjectMapper() mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL) return mapper.writeValueAsBytes(`object`) }
Map object to JSON bytes