Package eu.europa.esig.json
Class JsonObjectWrapper
java.lang.Object
eu.europa.esig.json.JsonObjectWrapper
Wraps a
com.github.erosb.jsonsKema.JsonObject and provides utility methods for working with it-
Constructor Summary
ConstructorsConstructorDescriptionJsonObjectWrapper(com.github.erosb.jsonsKema.JsonObject jsonObject) Default constructor -
Method Summary
Modifier and TypeMethodDescriptiongetAsNumber(String name) Gets a value of the headernameas a Number.getAsObject(String name) Gets a value of the headernameas a Json Object.getAsObjectList(String name) Gets a value of the headernameas a List of Json objects.getAsString(String name) Gets a value of the headernameas a String.getAsStringList(String name) Gets a value of the headernameas a List of Strings.protected com.github.erosb.jsonsKema.JsonObjectGets the wrapped JSON objectbooleanisEmpty()Returns whether the content of the current JSON object is empty or not
-
Constructor Details
-
JsonObjectWrapper
public JsonObjectWrapper(com.github.erosb.jsonsKema.JsonObject jsonObject) Default constructor- Parameters:
jsonObject-JsonObject
-
-
Method Details
-
getAsObject
Gets a value of the headernameas a Json Object. If not present, or not able to convert, returns NULL.- Parameters:
name-Stringheader name to get a value for- Returns:
JsonObjectWrapper
-
getAsString
Gets a value of the headernameas a String. If not present, or not able to convert, returns NULL. -
getAsNumber
Gets a value of the headernameas a Number. If not present, or not able to convert, returns NULL. -
getAsObjectList
Gets a value of the headernameas a List of Json objects. If not present, or not able to convert, returns empty list.- Parameters:
name-Stringheader name to get a value for- Returns:
- a list of
JsonObjectWrappers
-
getAsStringList
Gets a value of the headernameas a List of Strings. If not present, or not able to convert, returns empty list. -
isEmpty
public boolean isEmpty()Returns whether the content of the current JSON object is empty or not- Returns:
- TRUE if the JSON object does not contain any properties, FALSE otherwise
-
getJsonObject
protected com.github.erosb.jsonsKema.JsonObject getJsonObject()Gets the wrapped JSON object- Returns:
JsonObject
-