public PdxInstance toPdxInstance(Object json, String... identityFields) {
    if (regionService != null && regionService instanceof ProxyCache) {
      ProxyCache proxyCache = (ProxyCache) regionService;
      UserAttributes.userAttributes.set(proxyCache.getUserAttributes());
    }
    JsonParser jp = null;
    try {
      if (json instanceof String) {
        jp = new JsonFactory().createParser((String) json);

      } else if (json instanceof byte[]) {
        jp = new JsonFactory().createParser((byte[]) json);
      } else {
        throw new JSONFormatterException("Could not parse the " + json.getClass() + " type");
      }
      enableJSONParserFeature(jp);
      return getPdxInstance(jp, states.NONE, null, identityFields).getPdxInstance();
    } catch (JsonParseException jpe) {
      throw new JSONFormatterException("Could not parse JSON document ", jpe);
    } catch (IOException e) {
      throw new JSONFormatterException("Could not parse JSON document: " + jp.getCurrentLocation(),
          e);
    } catch (Exception e) {
      throw new JSONFormatterException("Could not parse JSON document: " + jp.getCurrentLocation(),
          e);
    } finally {
      UserAttributes.userAttributes.set(null);
    }
  }
Converts a JSON document (String or Byte Array) into a PdxInstance

@param json The JSON document (String or Byte Array) to convert to PDX
@param identityFields Any desired identity fields on the JSON object to be used for equals and
       hashCode computations
@return The PdxInstance
@throws JSONFormatterException if unable to create the PdxInstance
geode-core/src/main/java/org/apache/geode/pdx/JSONFormatter.java