static String getKey(String param) { String[] keys = param.split(":"); for (int i=keys.length-1; i>=0; i--) { if (Utilities.parseArrayIndex(keys[i]) == -1) { return keys[i]; } } return param; }
private Object makeNode(ArrayList<String> keys, int i, Object paramValue) { if (i+1 == keys.size()) { return paramValue; } else if (Utilities.parseArrayIndex(keys.get(i+1)) != -1) { return new ArrayList(Utilities.parseArrayIndex(keys.get(i+1))); } else { return new HashMap(); } }
static String permute(String fullparam, boolean allowValueChange) { String[] params = fullparam.split("[|]"); ArrayList<String> out = new ArrayList<>(); for (String eachparam: params) { if (allowValueChange && eachparam.contains("~") && !eachparam.contains("%")) { String[] param = eachparam.split("~", 2); out.add(param[0] + "~" + Utilities.invert(param[1])); } else { String[] keys = eachparam.split(":"); String[] param = null; if (eachparam.contains("~")) { param = eachparam.split("~", 2); keys = param[0].split(":"); } for (int i = keys.length - 1; i >= 0; i--) { if (Utilities.parseArrayIndex(keys[i]) == -1) { keys[i] += Utilities.randomString(6); break; } } String tempOut = String.join(":", keys); if (eachparam.contains("~")) { tempOut += "~" + param[1]; } out.add(tempOut); } } return String.join("|", out); }
boolean isArray = Utilities.parseArrayIndex(keys.get(0)) != -1; Object base; if (isArray) { boolean setValue = i + 1 == keys.size(); int index = Utilities.parseArrayIndex(key); if (index != -1) { ArrayList injectionPoint = (ArrayList) next;
for(String key: keys) { String lastKey = Keysmith.parseKey(key)[1]; if (Utilities.parseArrayIndex(lastKey) < 3) { filteredKeys.add(Keysmith.parseKey(key)[1]);