@SuppressWarnings("unchecked") public static <T> Map<String, T> protectSensitiveInfo(Map<String, T> data, T replacement) { Map<String, T> copy = U.map(); for (Map.Entry<String, T> e : data.entrySet()) { T value = e.getValue(); String key = e.getKey().toLowerCase(); if (value instanceof Map<?, ?>) { value = (T) protectSensitiveInfo((Map<String, T>) value, replacement); } else if (sensitiveKey(key)) { value = replacement; } copy.put(e.getKey(), value); } return copy; }
@Override public String toString() { String info = verb() + " " + path(); if (U.notEmpty(params)) { info += "?" + U.join("&", Msc.protectSensitiveInfo(params, "<...>").entrySet()); } return info; }
@SuppressWarnings("unchecked") @Override public Object call() { List<Object> grids = U.list(); Map<String, Object> sections = U.cast(Conf.ROOT.toMap()); sections = Msc.protectSensitiveInfo(sections, FA.QUESTION_CIRCLE); Map<String, Object> root = U.map(); for (Map.Entry<String, Object> entry : sections.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); if (value instanceof Map<?, ?>) { grids.add(h4(span(key).class_("label " + styleOf(key)))); grids.add(grid((Map<String, ?>) value)); } else { root.put(key, value); } } if (!root.isEmpty()) { grids.add(0, h4(span("<root>").class_("label " + styleOf("<root>")))); grids.add(1, grid(root)); } return multi(grids); }
@Override public String toString() { String info = verb() + " " + path(); if (U.notEmpty(params)) { info += "?" + U.join("&", Msc.protectSensitiveInfo(params, "<...>").entrySet()); } return info; }
@SuppressWarnings("unchecked") @Override public Object call() throws Exception { List<Object> grids = U.list(); Map<String, Object> sections = U.cast(Conf.ROOT.toMap()); sections = Msc.protectSensitiveInfo(sections, FA.QUESTION_CIRCLE); Map<String, Object> root = U.map(); for (Map.Entry<String, Object> entry : sections.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); if (value instanceof Map<?, ?>) { grids.add(h4(span(key).class_("label " + styleOf(key)))); grids.add(grid((Map<String, ?>) value)); } else { root.put(key, value); } } if (!root.isEmpty()) { grids.add(0, h4(span("<root>").class_("label " + styleOf("<root>")))); grids.add(1, grid(root)); } return multi(grids); }