code: public static <T> T convertObject(String json, Class<T> clazz) throws IOException {
          try {
              if (clazz.isAnnotationPresent(Model.class)) {
                  return MODEL_MAPPER.readValue(json, clazz);
              }
              return MAPPER.readValue(json, clazz);
          } catch (IOException e) {
              String error = String.format("Unable to parse given json '%s' into class '%s'.", json, clazz.getName());
              LOGGER.error(error, e);
              throw new IOException(error, e);
          }
      }
docs: Converts an object in JSON format to the given class. Throws an IOException if the conversion could not be
  performed.