com.fivefaces.cloud.workflow.awsonprem.utils.JsonPathUtils Maven / Gradle / Ivy
package com.fivefaces.cloud.workflow.awsonprem.utils;
import com.jayway.jsonpath.DocumentContext;
import java.util.LinkedHashMap;
public class JsonPathUtils {
public static void forcePut(DocumentContext context, String path, Object value) {
int pos = path.lastIndexOf('.');
String parent = path.substring(0, pos);
String child = path.substring(pos + 1);
if (context.read(parent) == null) {
forcePut(context, parent, new LinkedHashMap<>());
}
context.put(parent, child, value);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy