Package edu.suffolk.litlab.efsp.utils
Class JsonHelpers
java.lang.Object
edu.suffolk.litlab.efsp.utils.JsonHelpers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBoolMember(com.fasterxml.jackson.databind.JsonNode obj, String memberName) getIntMember(com.fasterxml.jackson.databind.JsonNode obj, String memberName) getMemberList(com.fasterxml.jackson.databind.JsonNode obj, String memberName) getNonEmptyStringMember(com.fasterxml.jackson.databind.JsonNode obj, String memberName) static Optional<BigDecimal> getNumberMember(com.fasterxml.jackson.databind.JsonNode obj, String memberName) static StringgetStringDefault(com.fasterxml.jackson.databind.JsonNode obj, String memberName, String def) getStringMember(com.fasterxml.jackson.databind.JsonNode obj, String memberName) static booleanisNull(com.fasterxml.jackson.databind.JsonNode j) static com.hubspot.algebra.Result<Optional<com.fasterxml.jackson.databind.JsonNode>, com.hubspot.algebra.NullValue> unwrapDADict(com.fasterxml.jackson.databind.JsonNode obj) static Optional<com.fasterxml.jackson.databind.JsonNode> unwrapDAList(com.fasterxml.jackson.databind.JsonNode obj) Returns the JsonNode where `.isArray()` is true.unwrapSimpleDict(com.fasterxml.jackson.databind.JsonNode obj)
-
Constructor Details
-
JsonHelpers
public JsonHelpers()
-
-
Method Details
-
isNull
public static boolean isNull(com.fasterxml.jackson.databind.JsonNode j) -
getStringMember
-
getNonEmptyStringMember
-
getStringDefault
-
getIntMember
-
getNumberMember
public static Optional<BigDecimal> getNumberMember(com.fasterxml.jackson.databind.JsonNode obj, String memberName) -
getBoolMember
-
getMemberList
-
unwrapDAList
public static Optional<com.fasterxml.jackson.databind.JsonNode> unwrapDAList(com.fasterxml.jackson.databind.JsonNode obj) Returns the JsonNode where `.isArray()` is true.For DAList objects, Docassemble puts the actual JSON array nested in the `elements` attribute. This function lets you treat a normal JSON array and a DAList JSON object the same.
-
unwrapDADict
public static com.hubspot.algebra.Result<Optional<com.fasterxml.jackson.databind.JsonNode>,com.hubspot.algebra.NullValue> unwrapDADict(com.fasterxml.jackson.databind.JsonNode obj) -
unwrapSimpleDict
-