Class JsonPathUtil
java.lang.Object
com.ultikits.ultitools.utils.JsonPathUtil
JSON path utility class - replaces hutool-json's putByPath/getByPath functionality
Provides dot-separated path access and mutation of values inside a nested JSON Map.
Usage example: Map<String, Object> json = new LinkedHashMap<>(); JsonPathUtil.putByPath(json, "a.b.c", "value"); Object value = JsonPathUtil.getByPath(json, "a.b.c"); // "value"
- Since:
- 6.2.0
- Author:
- UltiKits Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsPath(Map<String, Object> json, String path) Checks whether a path exists.static BooleanGets a Boolean value in a nested Map by path.static ObjectGets a value in a nested Map by path.static DoubleGets a Double value in a nested Map by path.static IntegerGets an Integer value in a nested Map by path.static LongGets a Long value in a nested Map by path.static StringGets a String value in a nested Map by path.static voidSets a value in a nested Map by path, automatically creating intermediate levels.static ObjectremoveByPath(Map<String, Object> json, String path) Removes a value in a nested Map by path.
-
Constructor Details
-
JsonPathUtil
private JsonPathUtil()
-
-
Method Details
-
getByPath
-
getStr
-
getInt
-
getLong
-
getBool
-
getDouble
-
putByPath
-
removeByPath
-
containsPath
-