protected String convert(final PdxInstance pdxObj) {
    try {
      return (pdxObj != null ? JSONFormatter.toJSON(pdxObj) : null);
    } catch (JSONFormatterException jpe) {
      throw new GemfireRestException("Requested data could not convert into REST format(JSON)!",
          jpe);
    }
  }
AbstractBaseController class contains common functionalities required for other controllers.

@since GemFire 8.0
geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/AbstractBaseController.java