class GraphInventoryPatchConverter {

    protected String marshallObjectToPatchFormat(Object obj) {
        Object value = obj;
        try {
            if (!(obj instanceof Map || obj instanceof String)) {
                value = patchProvider.getMapper().writeValueAsString(obj);
            } else if (obj instanceof Map) {
                value = standardProvider.getMapper().writeValueAsString(obj);
            }
        } catch (JsonProcessingException e) {
            value = "{}";
        }

        return (String) value;
    }

}