| 415 | } |
| 416 | |
| 417 | @SuppressForbidden( |
| 418 | reason = "singletonList(null) is intentional — null is a sentinel path element") |
| 419 | public static Object getObjectByPath(Object root, boolean onlyPrimitive, String hierarchy) { |
| 420 | if (hierarchy == null) |
| 421 | return getObjectByPath(root, onlyPrimitive, Collections.singletonList(null)); |
| 422 | List<String> parts = StrUtils.splitSmart(hierarchy, '/', true); |
| 423 | return getObjectByPath(root, onlyPrimitive, parts); |
| 424 | } |
| 425 | |
| 426 | public static boolean setObjectByPath(Object root, String hierarchy, Object value) { |
| 427 | List<String> parts = StrUtils.splitSmart(hierarchy, '/', true); |