code: public static String toJson(Object object) {
          Objects.requireNonNull(object, Required.OBJECT.toString());
          
          String json = null;
          try {
              json = mapper.writeValueAsString(object);
          } catch (JsonProcessingException e) {
              LOG.error("Failed to convert object to json",  e);
          }
          
          return json;
      }
docs: Converts a given object to a Json string
  
  @param object The object to convert
  @return json string or null if conversion fails